Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-01-10 22:21:22


Noah Stein wrote:

>Your Create() function in AllocateUsingNew isn't guaranteed to work for all
>classes. The type of the singleton class might have alignment restrictions.
>char has no alignment restrictions; therefore, the program may crash when
>trying to initialize the singleton. I believe boost::aligned_storage is
>your friend in this situation.
>
Thanks for the heads up. Although the implementation of
AllocateUsingNew has since been changed and now is able to use regular
new, my static allocation class still would have this problem. I'll
look into aligned storage immediately.

-Jason


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