109 constexpr off_A a {};
110 static_assert (to_underlying (a) == 0,
"");
113 constexpr off_A res1 = a + 2;
114 static_assert (to_underlying (res1) == 2,
"");
116 constexpr off_A res2 = res1 - 1;
117 static_assert (to_underlying (res2) == 1,
"");
121 constexpr off_A res1 = 2 + a;
122 static_assert (to_underlying (res1) == 2,
"");
124 constexpr off_A res2 = 3 - res1;
125 static_assert (to_underlying (res2) == 1,
"");
134 SELF_CHECK (to_underlying (o) == 10);
136 SELF_CHECK (to_underlying (o) == 5);
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,
"");