Boost logo

Boost :

Subject: [boost] New Container: Hashed Vector
From: Sam Hertz (slhertz_at_[hidden])
Date: 2011-12-03 21:29:56


Boost Developers,

Let me start by saying that I love the Boost Libraries. I use them
frequently.
Most of the time, when I need some unique data structure in my code, Boost
can solve my problems.
I saw the recent release of the Container library and I love the idea of
the flat_set/map structures.

In my code, I require a data structure that has fast associative lookup
(like an unordered_set). However, this data structure should preserve the
order of element insertion. In other words, the data structure would be
similar to the flat_set/map structures, but would preserve order of
insertion instead of relying on the < operator or a Comparable function
object. Right now, I am calling this structure a hashed_vector.

I am aware of Boost.Multi-Index, but this library is very general purpose
and cumbersome to use to implement a hashed_vector. Ideally the structure
would have an identical interface to the std::vector class, but with a much
speedier find member function. Right now I am creating a wrapper class for
multi_index_container to implement the hashed_vector, but hopefully a more
direct implementation could be added to the Boost Libraries.

I am sharing this idea with all of you because I want to see if you think
such a structure is worth including in the libraries and if anyone is
interested in implementing it. I would love to implement it myself, but I
am currently a full-time graduate student and my experience with template
programming is laughable when considering the amount currently used in the
Boost Libraries.

Looking forward to your feedback!

Sam


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