Boost logo

Boost :

Subject: Re: [boost] [Smart Ptr] make_shared slower than shared_ptr(new) on VC++9 (and 10) with fix
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-04-26 16:33:57

On Thursday 26 April 2012 22:26:24 Mathias Gaunard wrote:
> On 26/04/12 22:08, Jeffrey Lee Hellrung, Jr. wrote:
> > Doesn't the same thing happen in boost::optional and boost::variant?
> Yes, their code is arguably ill-formed, but I'm sure some people claim
> otherwise.
> AFAIK the only way to implement this in a standard conforming way is
> with C++11 unrestricted unions.
> Alternatively, all compilers that implement strict aliasing provide
> attributes to allow aliasing locally.

I think, std::aligned_storage is intended for this.

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