Boost logo

Boost :

Subject: Re: [boost] sentinels vs iterators
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-08-23 14:53:44


Mathias Gaunard <mathias.gaunard <at> ens-lyon.org> writes:

>
> On 21/08/2014 12:12, Joaquin M Lopez Munoz wrote:
> > Some
> > months ago I explored a container-like construct for polymorphic
> > objects that group elements by run-time type so as to greatly
> > speed up for_each processing:
> >
> > http://bannalia.blogspot.com.es/2014/05/fast-polymorphic-collections.html
>
> IMHO you're comparing oranges and apples, the memory layout and
> traversal properties are entirely different.

Absolutely, this is precisely the point of the article: if you are managing
collections of polymorphics objects and traversal order is not relevant,
you are probably better off using something like poly_collection (or the
intrusive structure you mention) rather than
std::vector<std::unique_ptr<Base>> (or boost::ptr_vector<Base>, for that
matter).

Joaquín M López Muñoz
Telefónica


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