Boost logo

Boost :

Subject: Re: [boost] [cpo-proposal] presentation of the idea
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2013-08-28 11:37:11


On Wed, Aug 28, 2013 at 8:51 AM, Larry Evans <cppljevans_at_[hidden]>wrote:

> On 08/27/13 23:51, Gottlob Frege wrote:
>
> > char * space = make_space_for_item(handler->size()); // make space in
> > vector<char>
> > handler->do_copy(space, item); inplace copy construct
> How does make_space_for_item assure the return value is aligned
> properly for an Item type?
> [snip]
>
>
>
Well, I guess it would also need some kind of handler->alignment().

make_space_for_item(handler->size(), handler->alignment());

you would look at the end of the vector<char> and see if it aligns or how
much you need to fudge there. So add enough for alignment + size and
return the aligned address.


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