Boost logo

Boost :

Subject: Re: [boost] Interest in a "Heterogenous Container" system?
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-08-03 12:08:29


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 02 August 2009, Christian Schladetsch wrote:
> On Mon, Aug 3, 2009 at 5:44 AM, Frank Mori Hess <fmhess_at_[hidden]>wrote:
> > On Saturday 01 August 2009, Mathias Gaunard wrote:
> > > I personally never understood why they tied the type into the
> > > allocator. Having just the size and alignment would be so much better.
> >
> > It seems to me any benefits of such a scheme would be non-portable, since
> > the sizes and alignments of two types may be the same with one compiler
> > (setting) and different with others.
>
> I don't see a problem. As long as the objects are created with correct
> alignment for a given compiler (setting), what that alignment is, is not
> important.

I wasn't following the thread too closely, but I assumed the benefit of using
size+alignment instead of type would be that you could reuse the same
allocator with different types (as long as they had the same size and
alignment). But since a type's size+alignment varies across platforms, you
wouldn't be able to portably reuse such an allocator with different types
(hence no portable benefit).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkp3C30ACgkQ5vihyNWuA4Ua8wCglhRtt1cSITwrVJ/9dP61dOF5
700AniWhvKV/l2Yq+VIEnsSODZjNWr+H
=dl4g
-----END PGP SIGNATURE-----


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