Add SFINAE conditions

This commit is contained in:
Peter Dimov
2017-05-31 07:42:45 +03:00
parent abb7b551cc
commit 7d25e131be
6 changed files with 115 additions and 21 deletions

View File

@@ -43,6 +43,11 @@ STATIC_ASSERT( !std::is_nothrow_default_constructible<X2>::value );
STATIC_ASSERT( !std::is_nothrow_copy_constructible<X2>::value );
STATIC_ASSERT( !std::is_nothrow_move_constructible<X2>::value );
struct Y
{
Y( Y const& ) = delete;
};
template<class V> static void test( V const & v )
{
V v2( v );
@@ -114,6 +119,9 @@ int main()
BOOST_TEST_TRAIT_FALSE((std::is_nothrow_copy_constructible<variant<X1, X2>>));
BOOST_TEST_TRAIT_FALSE((std::is_nothrow_copy_constructible<variant<X1, X2, int, int>>));
BOOST_TEST_TRAIT_TRUE((std::is_copy_constructible<variant<X1, X2>>));
BOOST_TEST_TRAIT_FALSE((std::is_copy_constructible<variant<int, float, Y>>));
}
return boost::report_errors();