14 Jun
2017
14 Jun
'17
5:10 p.m.
Andrzej Krzemienski wrote:
Now I realize this all means the types inside variant need to be movable. This will not be a problem in most of the cases, but does it mean I cannot use variant2 with non-movable types?
You can, it will double-buffer to keep emplace strong. Or you can use valueless. All types nothrow move constructible -> single buffer; Otherwise, first alternative is valueless -> single buffer; Otherwise -> double buffer.