Add a test case to test/variant_copy_construct

This commit is contained in:
Peter Dimov
2020-01-23 18:33:39 +02:00
parent 8cf72527a6
commit d6680df4e5

View File

@@ -48,6 +48,13 @@ struct Y
Y( Y const& ) = delete; Y( Y const& ) = delete;
}; };
struct D
{
~D() {}
};
inline bool operator==( D, D ) { return true; }
template<class V> static void test( V const & v ) template<class V> static void test( V const & v )
{ {
V v2( v ); V v2( v );
@@ -117,6 +124,8 @@ int main()
test( v ); test( v );
} }
test( variant<D>() );
{ {
BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int>>)); BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int>>));
BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int const>>)); BOOST_TEST_TRAIT_TRUE((std::is_nothrow_copy_constructible<variant<int const>>));