|
Boost : |
Subject: Re: [boost] [cpo-proposal] presentation of the idea
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2013-08-29 04:23:34
On 28-08-2013 17:50, Gottlob Frege wrote:
> On Wed, Aug 28, 2013 at 2:57 AM, Thorsten Ottosen <
> thorsten.ottosen_at_[hidden]> wrote:
> Well I think there are trade offs. Is locality the number one feature?
Yes. If that os not your use case, then you have many of other options
which are somewhat easier to use.
> It might be better to store the size (and type) of each object right beside
> the object inside the data vector then. So at least iterating is local.
Could be an option. Might even be a good one. Experiments will tell.
> I would still use Type Handlers for copy/move. I think it is OK if
> copy/move is slightly less local.
>
> You could also probably track whether any of the Items have non-trivial
> copy/move operators. ie in push_back<Item>() increment a nonTrivalCounter.
> If nonTrivialCounter == 0 on copy/move, then do a memcpy, otherwise use the
> Handlers to copy.
This is way too complicated. It's unlikely that all objects would be
trivial, probably impossible, since the objects needs to have a base class.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk