Boost logo

Boost :

Subject: [boost] Offering sorted_vector for Boost, any interest?
From: Frank Birbacher (bloodymir.crap_at_[hidden])
Date: 2012-02-15 13:52:52


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

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

Possible things that I currently consider:
- - offer one-time initialization read-only sorted container?
- - offer mutable container with std::set-like interface (complexity
changes)?
- - offer taking contents from std::vector for init without copying
- - offer equivalent to std::map also?
- - provide a pointer container, too?

Is there general interest in such a container? I'd like to develop an
implementation and offer it to Boost.

Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: keyserver x-hkp://pool.sks-keyservers.net

iEYEARECAAYFAk87/wQACgkQhAOUmAZhnmqVdQCggs40nPsT7wXvoEuO3TsSWlqS
Wt4An06uRHECRercybiKC0Jq/ZKobEsu
=zAK6
-----END PGP SIGNATURE-----


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