diff --git a/test/variant_index_type.cpp b/test/variant_index_type.cpp index 94a532e..ebe76b1 100644 --- a/test/variant_index_type.cpp +++ b/test/variant_index_type.cpp @@ -47,17 +47,19 @@ template class F, std::size_t N> void test_() { using V = mp_rename< mp_transform>, boost::variant2::variant >; + using last_type = F>; + { - V v( mp_back{} ); - BOOST_TEST_EQ( v.index(), mp_size() - 1 ); + V v( last_type{} ); + BOOST_TEST_EQ( v.index(), N-1 ); } { V v; BOOST_TEST_EQ( v.index(), 0 ); - v.template emplace< mp_back >(); - BOOST_TEST_EQ( v.index(), mp_size() - 1 ); + v.template emplace(); + BOOST_TEST_EQ( v.index(), N-1 ); } }