Subject: Re: [boost] variant2 never empty guarantees (was: Re: Outcome/expected/etc/etc/etc)
From: Peter Dimov (lists_at_[hidden])
Date: 2017-06-14 16:21:49
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk