RE: [boost] Re: Re: immutable string

Maxim Yegorushkin <e-maxim@yandex.ru> wrote:
Ben Hutchings <ben.hutchings@businesswebsoftware.com> wrote:
[]
But I think there might be another solution. The standard states in 5.3.4.10 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. <snip> 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?
Right.
participants (1)
-
Ben Hutchings