| 60 | }; |
| 61 | |
| 62 | void test_pointer() { |
| 63 | simple t{}; |
| 64 | auto&& [o, b, c, d] = t; |
| 65 | size_t offset1 = (const char*)(&o) - (const char*)(&t); |
| 66 | size_t offset2 = (const char*)(&b) - (const char*)(&t); |
| 67 | size_t offset3 = (const char*)(&c) - (const char*)(&t); |
| 68 | size_t offset4 = (const char*)(&d) - (const char*)(&t); |
| 69 | |
| 70 | const auto& offset_arr = member_offsets<simple>; |
| 71 | CHECK(offset_arr[0] == offset1); |
| 72 | CHECK(offset_arr[1] == offset2); |
| 73 | CHECK(offset_arr[2] == offset3); |
| 74 | CHECK(offset_arr[3] == offset4); |
| 75 | } |
| 76 | |
| 77 | TEST_CASE("test member pointer and offset") { test_pointer(); } |
| 78 | |