
28 Aug
2013
28 Aug
'13
3:37 p.m.
On Wed, Aug 28, 2013 at 8:51 AM, Larry Evans
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.