2017-06-14 18:21 GMT+02:00 Peter Dimov via Boost
Andrzej Krzemienski wrote:
If you are not doing double buffering, how can you guarantee that
`emplace` is strong? You move the original to the side?
I could do that, but I construct on the side instead and move it into place. This is another instance where people may disagree because emplace should as a principle always construct in-place. But realistically, construct on the side + move is never inferior to move original to the side, construct in-place, optionally move original back if constructor throws.
Given that you have to move something anyway, I guess you are right. 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? Regards, &rzej;