Skip to content

Commit 2e5416d

Browse files
Make templaitization less awkward
1 parent abc0689 commit 2e5416d

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

libcxx/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,20 @@
2424

2525
template <class VB>
2626
TEST_CONSTEXPR_CXX20 void test() {
27-
{
28-
typedef VB T;
29-
typedef std::hash<T> H;
27+
typedef std::hash<VB> H;
3028
#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), "");
3331
#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);
4441
}
4542
}
4643

0 commit comments

Comments
 (0)