Boost logo

Boost :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2004-09-22 10:46:19

Maxim Yegorushkin <e-maxim_at_[hidden]> wrote:
> Ben Hutchings <ben.hutchings_at_[hidden]> wrote:
> []
> >> But I think there might be another solution. The standard states in
> >> that arrays of char's allocated with new expression are
> >> always properly aligned for types whose size is no greater than the
> >> size of the array. Does allocator<char>::allocate() have the same
> >> requirement? I could not find it in my copy of the standard.
> > However, the requirements for
> > allocators in general (table 32 in subclause 20.1.5) say only that
> > "[m]emory is allocated for n objects of type T" by the allocate()
> > function.
> So, that means that there is no requirement and thus it is not
> guarantied that any custom_allocator<char> returns a pointer
> properly aligned for any type, right?


Boost list run by bdawes at, gregod at, cpdaniel at, john at