|
Boost : |
Subject: Re: [boost] aligned_storage in unions
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-09-22 14:14:21
On 09/22/10 13:00, Frank Mori Hess wrote:
> On Wednesday 22 September 2010, Larry Evans wrote:
>> Strict aliasing is an assumption, made by the C (or C++) compiler,
>> that dereferencing pointers to objects of different types will
>> never refer to the same memory location (i.e. alias each other.)
>
>> Could you point to the variant code violating this rule?
>
> How about if you re-assign a variant to a different type. Won't it re-use the
> same in-place storage for a different type?
>
Yes, AFAICT. Thanks.
So now my other question: how can C++0x avoid this?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk