Boost logo

Boost :

Subject: Re: [boost] [variant2] documentation request
From: Peter Dimov (lists_at_[hidden])
Date: 2019-03-03 18:05:32

Gottlob Frege wrote:

> And do you sometimes do the opposite order - memcpy *this to a temporary,
> emplace into this, memcpy back from the temporary if emplace failed?

No, I don't do this. This is a trick that gets us close to the strong
guarantee, but not all the way, so it's not worth doing.

There are more evil variations, such as memcpy *this, emplace, if failed
memcpy back, if not failed memcpy the new *this into another temp, memcpy
the original back, invoke destructor, memcpy the new temp back. Totally
undefined, of course, but could have worked in practice before compilers
started getting clever with their lifetime tracking.

Boost list run by bdawes at, gregod at, cpdaniel at, john at