forked from boostorg/variant2
Fix emplace for types with a deleted move constructor (in the trivially destructible case)
This commit is contained in:
@@ -57,6 +57,16 @@ STATIC_ASSERT( !std::is_nothrow_move_constructible<X2>::value );
|
||||
STATIC_ASSERT( !std::is_nothrow_copy_assignable<X2>::value );
|
||||
STATIC_ASSERT( !std::is_nothrow_move_assignable<X2>::value );
|
||||
|
||||
struct Y1
|
||||
{
|
||||
};
|
||||
|
||||
struct Guard
|
||||
{
|
||||
explicit Guard(int) {}
|
||||
Guard(Guard&&) = delete;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -165,5 +175,10 @@ int main()
|
||||
BOOST_TEST_EQ( get<0>(v).v, 4 );
|
||||
}
|
||||
|
||||
{
|
||||
variant<Y1, Guard> v;
|
||||
v.emplace<Guard>( 1 );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user