Subject: Re: [boost] [interprocess] default constructors
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-12-05 19:00:27
David Abrahams wrote:
> on Wed Dec 03 2008, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:
>> David Abrahams wrote:
>>> I don't think it's unfortunate. Destructive move semantics is nearly
>>> impossible to use correctly in many conditions.
>> Would you mind giving examples?
> void f()
> X a;
> if (something)
> // ...
> // a.~X() ?
Indeed, in the general case, the compiler (this certainly shouldn't be
the job of the programmer) would have to transform the code to something
bool destruct_a = true;
destruct_a = false;
Usual const-propagation should be enough to optimize those booleans out
It's true however the current system is really much simpler since there
is no such work required for the compiler (and maybe it can be optimized
just as well?)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk