41 #define CHECK_VALID(VALID, EXPR_TYPE, EXPR) \ 42 CHECK_VALID_EXPR_2 (off_A, off_B, VALID, EXPR_TYPE, EXPR) 109 constexpr off_A a {};
113 constexpr off_A res1 = a + 2;
116 constexpr off_A res2 = res1 - 1;
121 constexpr off_A res1 = 2 + a;
124 constexpr off_A res2 = 3 - res1;
141 constexpr off_A o1 = (off_A) 10;
142 constexpr off_A o2 = (off_A) 20;
144 constexpr
unsigned int delta = o2 - o1;
146 static_assert (delta == 10,
"");
151 constexpr off_A o1 = (off_A) 10;
152 constexpr off_A o2 = (off_A) 20;
154 static_assert (o1 < o2,
"");
155 static_assert (!(o2 < o1),
"");
157 static_assert (o2 > o1,
"");
158 static_assert (!(o1 > o2),
"");
160 static_assert (o1 <= o2,
"");
161 static_assert (!(o2 <= o1),
"");
163 static_assert (o2 >= o1,
"");
164 static_assert (!(o1 >= o2),
"");
166 static_assert (o1 <= o1,
"");
167 static_assert (o1 >= o1,
"");
CHECK_VALID(true, off_A, off_A {}+undrl {})
void _initialize_offset_type_selftests()
constexpr std::underlying_type< E >::type to_underlying(E val) noexcept
std::underlying_type< off_A >::type undrl
void register_test(const std::string &name, selftest *test)
DEFINE_OFFSET_TYPE(off_A, unsigned int)
#define SELF_CHECK(VALUE)