Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-08-07 11:56:31


----- Original Message -----
From: "Douglas Gregor" <gregod_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, August 07, 2002 12:59 PM
Subject: Re: [boost] Mini-review request: aligned_storage.hpp

> On Wednesday 07 August 2002 10:58 am, Fernando Cacciola wrote:
> > I'm not sure if the interface which takes two integers is good, though;
It
> > does have potential for greater flexibility, but it is also
significantly
> > more obscure for the user (IMHO).
> > In all the examples of this sort of utility that I've seen, 'size_' is
> > always 'sizeof(T)' and 'alignment_' is always
> > 'boost::alignment_of<T>::value'; so, unless a concrete example pops up,
I
> > prefer to parametrize aligned_storage in terms of T + Count (for arrays)
+
> > a tag struct indicating minimum (default) or maximum alignment.
>
> Variant will have `size_` = the maximum size of any type in the variant
and
> `align_' = the LCM of all types in the variant.
>
I see. Thanks for the example.

Then a generator of the form

make_aligned_storage<T,Count,AlignChoice>::type

can provide the user friendly interface.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


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