20 template<auto left, auto right,
typename compare_t>
23 static_assert(compare_t()(left, right));
26 template<auto left, auto right>
29 static_assert(std::equal_to<>()(left, right),
"!(left == right)");
32 template<auto left, auto right>
35 static_assert(std::not_equal_to<>()(left, right),
"!(left != right)");
38 template<auto left, auto right>
41 static_assert(std::less<>()(left, right),
"!(left < right)");
44 template<auto left, auto right>
47 static_assert(std::less_equal<>()(left, right),
"!(left <= right)");
50 template<auto left, auto right>
53 static_assert(std::greater<>()(left, right),
"!(left > right)");
56 template<auto left, auto right>
59 static_assert(std::greater_equal<>()(left, right),
"!(left >= right)");
62 template<auto left, auto value, auto right>
65 static_assert(
qx::between(left, value, right),
"value is not between right and left");
73 #define QX_STATIC_ASSERT_EQ(left, right) \
74 constexpr qx::details::static_assert_two<(left), (right), std::equal_to<>> QX_LINE_NAME(_static_assert_eq_)
76 #define QX_STATIC_ASSERT_NE(left, right) \
77 constexpr qx::details::static_assert_two<(left), (right), std::not_equal_to<>> QX_LINE_NAME(_static_assert_nq_)
79 #define QX_STATIC_ASSERT_LT(left, right) \
80 constexpr qx::details::static_assert_two<(left), (right), std::less<>> QX_LINE_NAME(_static_assert_lt_)
82 #define QX_STATIC_ASSERT_LE(left, right) \
83 constexpr qx::details::static_assert_two<(left), (right), std::less_equal<>> QX_LINE_NAME(_static_assert_le_)
85 #define QX_STATIC_ASSERT_GT(left, right) \
86 constexpr qx::details::static_assert_two<(left), (right), std::greater<>> QX_LINE_NAME(_static_assert_gt_)
88 #define QX_STATIC_ASSERT_GE(left, right) \
89 constexpr qx::details::static_assert_two<(left), (right), std::greater_equal<>> QX_LINE_NAME(_static_assert_ge_)
98 #define QX_STATIC_ASSERT_BETWEEN(left, value, right) \
99 qx::details::static_assert_between<(left), (value), (right)> QX_LINE_NAME(static_assert_between_)
130 #define QX_STATIC_ASSERT_NO_INSTANTIATION(Message) \
131 []<bool flag = false>() \
133 static_assert(flag, Message); \
constexpr bool between(T left, T value, T right, compare_t compare)
Checks if value is between left and right.