From: Anthony Williams (anthony.williamsNOSPAM_at_[hidden])
Date: 2003-02-24 04:50:03
Thomas Witt <witt_at_[hidden]> writes:
> On Sunday 23 February 2003 20:03, Greg Colvin wrote:
> > At 03:34 AM 2/23/2003, Thomas Witt wrote:
> > >Greg,
> > >
> > >I can not figure out how you make sure to satisfy the alignment
> > > constraints of T and counted_base_header_impl. Any hint would be
> > > appreciated.
> > I just used two char arrays, thinking there was a dispensation
> > somewhere in the standard to allow for placement new into char
> > arrays:
> Yep, you are right its 5.3.4/10. I missed it.
That's only for char arrays directly allocated with new themselves, not char
arrays that are members or have automatic or static storage duration.
You need to look at boost::aligned_storage (which is part of boost::optional
-- Anthony Williams Senior Software Engineer, Beran Instruments Ltd. Remove NOSPAM when replying, for timely response.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk