Static asserts that exploit template expansion backtraces to show you the values involved in the failing assert.
More...
#include <StaticAssert.hpp>
|
template<auto X, auto Y> |
constexpr static void | Eq () |
| Assert that two values are equal. More...
|
|
template<auto X, auto Y> |
constexpr static void | Ne () |
| Assert that two values are not equal. More...
|
|
template<auto X, auto Y> |
constexpr static void | Lt () |
| Assert that X < Y . More...
|
|
template<auto X, auto Y> |
constexpr static void | Gt () |
| Assert that X > Y . More...
|
|
template<auto X, auto Y> |
constexpr static void | Le () |
| Assert that X <= Y . More...
|
|
template<auto X, auto Y> |
constexpr static void | Ge () |
| Assert that X >= Y . More...
|
|
template<auto X, auto Y> |
constexpr static void | Divisible () |
| Assert that X % Y == 0 . More...
|
|
template<typename X , typename Y > |
constexpr static void | TypeEq () |
| Assert two types are equal. More...
|
|
Static asserts that exploit template expansion backtraces to show you the values involved in the failing assert.
Custom messages can be supported with C++20 string tparams. Or a C++17 equivalent (although all such things that currently exist are necessarily insane).
◆ Divisible()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Divisible |
( |
| ) |
|
|
staticconstexpr |
◆ Eq()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Eq |
( |
| ) |
|
|
staticconstexpr |
Assert that two values are equal.
◆ Ge()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Ge |
( |
| ) |
|
|
staticconstexpr |
◆ Gt()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Gt |
( |
| ) |
|
|
staticconstexpr |
◆ Le()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Le |
( |
| ) |
|
|
staticconstexpr |
◆ Lt()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Lt |
( |
| ) |
|
|
staticconstexpr |
◆ Ne()
template<auto X, auto Y>
constexpr static void sp::StaticAssert::Ne |
( |
| ) |
|
|
staticconstexpr |
Assert that two values are not equal.
◆ TypeEq()
template<typename X , typename Y >
constexpr static void sp::StaticAssert::TypeEq |
( |
| ) |
|
|
staticconstexpr |
Assert two types are equal.