Boost logo

Boost :

Subject: Re: [boost] Interest in a container which can hold multiple data types?
From: James Armstrong (armstrhu_at_[hidden])
Date: 2015-05-05 16:59:15


On 5/5/2015 7:49 PM, Joaquin M Lopez Munoz wrote:
> TONGARI J <tongari95 <at> gmail.com> writes:
>
>> If the data sequence shows some affinity, I guess an ordered
>> tuple_vector-based sequence can provide some performance benefit in
>> traversal (with some crafted for_each method).
>>
>> That is, a sequence of [AAABBB] may be traversed faster than [ABABAB] for
>> such a container, and I believe in the later case such that the types are
>> uniformly distributed, vector<variant> will perform better.
> I wrote something on this some time ago, maybe worth having a look at:
>
> http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections.html
>
http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections-with.html
>

Nice analysis. If we can identify different use cases, we may be able to
come up with several implementations of heterogeneous containers which
balance efficiency and flexibility. I think it would be an interesting
project to work on and surely useful if the containers all the a similar
'feel'

-- 
James Armstrong

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