Boost logo

Boost :

Subject: Re: [boost] [interprocess] default constructors
From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-12-05 19:12:27


On Fri, Dec 5, 2008 at 4:00 PM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> void f()
> {
> X a;
> bool destruct_a = true;
>
> if (something)
> {
> g(move(a));
> destruct_a = false;
> }
> // ...
>
> if (destruct_a)
> a.~X();
> }
>
> Usual const-propagation should be enough to optimize those booleans out when
> possible.

I don't see how const-propagation is relevant here, but regardless --
const-propagation rarely (if ever) leads to optimization
possibilities.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk