|
Boost : |
Subject: Re: [boost] aligned_storage in unions
From: Trigve Siver (trigves_at_[hidden])
Date: 2010-09-24 04:52:22
> From: David Abrahams <dave_at_[hidden]>
> To: "boost_at_[hidden]" <boost_at_[hidden]>
> Sent: Thu, September 23, 2010 7:18:22 PM
> Subject: Re: [boost] aligned_storage in unions
>
>
> On Sep 23, 2010, at 11:37 AM, Frank Mori Hess wrote:
> >
> > What is this based on? There is a strict aliasing exception for char*, but
> > all I see in the standard about static_casting through void is (paragraph 10
>
> > of 5.2.9):
>
> Sorry, no time to trawl the standard right now. The above matches my hard-won
>understanding but of course I could always be wrong about anything ;-)
I think u mean 9.2/19:
"A pointer to a standard-layout struct object, suitably converted using a
reinterpret_cast, points to its initial member (or if that member is
a bit-field, then to the unit in which it resides) and vice versa. [ Note: There
might therefore be unnamed padding within a standard-layout
struct object, but not at its beginning, as necessary to achieve appropriate
alignment. =97end note ]"
> --
> Dave Abrahams
> BoostPro Computing
> http://boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk