@@ -208,16 +208,18 @@ TEST_CASE( "variant should correctly index types", "[variant]" ) {
208
208
REQUIRE (variant_type (float (0.0 )).get_type_index () == 0 );
209
209
}
210
210
211
- TEST_CASE ( " variant type traits" , " [variant::detail]" ) {
211
+ struct dummy {};
212
+
213
+ TEST_CASE ( " variant value traits" , " [variant::detail]" ) {
212
214
// Users should not create variants with duplicated types
213
215
// however our type indexing should still work
214
216
// Index is in reverse order
215
- REQUIRE ((util::detail::type_traits <bool , bool , int , double , std::string>::id == 3 ));
216
- REQUIRE ((util::detail::type_traits <int , bool , int , double , std::string>::id == 2 ));
217
- REQUIRE ((util::detail::type_traits <double , bool , int , double , std::string>::id == 1 ));
218
- REQUIRE ((util::detail::type_traits <std::string, bool , int , double , std::string>::id == 0 ));
219
- REQUIRE ((util::detail::type_traits< long , bool , int , double , std::string>::id == util::detail::invalid_value));
220
- REQUIRE ((util::detail::type_traits <std::vector<int >, bool , int , double , std::string>::id == util::detail::invalid_value));
217
+ REQUIRE ((util::detail::value_traits <bool , bool , int , double , std::string>::index == 3 ));
218
+ REQUIRE ((util::detail::value_traits <int , bool , int , double , std::string>::index == 2 ));
219
+ REQUIRE ((util::detail::value_traits <double , bool , int , double , std::string>::index == 1 ));
220
+ REQUIRE ((util::detail::value_traits <std::string, bool , int , double , std::string>::index == 0 ));
221
+ REQUIRE ((util::detail::value_traits<dummy , bool , int , double , std::string>::index == util::detail::invalid_value));
222
+ REQUIRE ((util::detail::value_traits <std::vector<int >, bool , int , double , std::string>::index == util::detail::invalid_value));
221
223
}
222
224
223
225
TEST_CASE ( " variant default constructor" , " variant()" ) {
0 commit comments