Fix tests when X3 is not v2d::trivially_move_assignable

This commit is contained in:
Peter Dimov
2018-10-18 17:46:32 +03:00
parent 0e72d274a7
commit a13ccee145

View File

@ -230,8 +230,18 @@ int main()
} }
catch( std::exception const& ) catch( std::exception const& )
{ {
// all trivially destructible and move-assignable, no change // X3 is not v2d::trivially_move_assignable on libstdc++ 4.x
BOOST_TEST_EQ( v.index(), 0 );
if( v2d::is_trivially_move_assignable<X3>::value )
{
// all trivially destructible and move-assignable, no change
BOOST_TEST_EQ( v.index(), 0 );
}
else
{
// basic guarantee; X1 is nothrow default-constructible
BOOST_TEST_EQ( v.index(), 1 );
}
} }
} }
@ -247,8 +257,18 @@ int main()
} }
catch( std::exception const& ) catch( std::exception const& )
{ {
// all trivially destructible and move-assignable, no change // X3 is not v2d::trivially_move_assignable on libstdc++ 4.x
BOOST_TEST_EQ( v.index(), 0 );
if( v2d::is_trivially_move_assignable<X3>::value )
{
// all trivially destructible and move-assignable, no change
BOOST_TEST_EQ( v.index(), 0 );
}
else
{
// basic guarantee; monostate
BOOST_TEST_EQ( v.index(), 2 );
}
} }
} }