|
24 | 24 |
|
25 | 25 | template <class VB> |
26 | 26 | TEST_CONSTEXPR_CXX20 void test() { |
27 | | - { |
28 | | - typedef VB T; |
29 | | - typedef std::hash<T> H; |
| 27 | + typedef std::hash<VB> H; |
30 | 28 | #if TEST_STD_VER <= 14 |
31 | | - static_assert((std::is_same<H::argument_type, T>::value), ""); |
32 | | - static_assert((std::is_same<H::result_type, std::size_t>::value), ""); |
| 29 | + static_assert((std::is_same<H::argument_type, VB>::value), ""); |
| 30 | + static_assert((std::is_same<H::result_type, std::size_t>::value), ""); |
33 | 31 | #endif |
34 | | - ASSERT_NOEXCEPT(H()(T())); |
35 | | - |
36 | | - bool ba[] = {true, false, true, true, false}; |
37 | | - T vb(std::begin(ba), std::end(ba)); |
38 | | - H h; |
39 | | - if (!TEST_IS_CONSTANT_EVALUATED) { |
40 | | - const std::size_t hash_value = h(vb); |
41 | | - assert(h(vb) == hash_value); |
42 | | - LIBCPP_ASSERT(hash_value != 0); |
43 | | - } |
| 32 | + ASSERT_NOEXCEPT(H()(VB())); |
| 33 | + |
| 34 | + bool ba[] = {true, false, true, true, false}; |
| 35 | + VB vb(std::begin(ba), std::end(ba)); |
| 36 | + H h; |
| 37 | + if (!TEST_IS_CONSTANT_EVALUATED) { |
| 38 | + const std::size_t hash_value = h(vb); |
| 39 | + assert(h(vb) == hash_value); |
| 40 | + LIBCPP_ASSERT(hash_value != 0); |
44 | 41 | } |
45 | 42 | } |
46 | 43 |
|
|
0 commit comments