Boost logo

Boost :

Subject: Re: [boost] Offering sorted_vector for Boost, any interest?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-02-15 14:18:52


AMDG

On 02/15/2012 10:52 AM, Frank Birbacher wrote:
> I've come across lots of code that uses std::set where I think a
> sorted vector would perform better. Those places a characterized by:
> 1. fills the set only once,
> 2. just wants to drop duplicates or
> 3. calls set::find very often.
> Facing such code I often wished there was a ready to use sorted_vector
> implementation.
>
> I think a new container that stores elements in a vector instead of a
> tree offers strong advantages:
> a. one call to std::sort instead of managing a red-black-tree
> b. less memory overhead
> c. better data locality for lookup
>

Have you seen boost::container::flat_set?

In Christ,
Steven Watanabe


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