14 Jun
2017
14 Jun
'17
4:21 p.m.
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.