Fix emplace for types with a deleted move constructor (in the not trivially destructible case)

This commit is contained in:
Peter Dimov
2019-04-09 19:22:04 +03:00
parent 9f7e525984
commit 2d6385031e
2 changed files with 59 additions and 39 deletions

View File

@@ -61,6 +61,11 @@ struct Y1
{
};
struct Y2
{
~Y2() {}
};
struct Guard
{
explicit Guard(int) {}
@@ -180,5 +185,10 @@ int main()
v.emplace<Guard>( 1 );
}
{
variant<Y2, Guard> v;
v.emplace<Guard>( 1 );
}
return boost::report_errors();
}