Boost logo

Boost :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2004-03-18 03:37:51

David B. Held <dheld <at>> writes:

> "Peter Palotas" <peter <at>> wrote in message
> news:auto-000000364385 <at>
> > I was wondering if there is any interest in a container that is a
> > model of sequence (just like std::vector or std::list) and with an
> > interface matching that of std::vector (maybe with minor
> > differences due to effiency) but with different time complexities?
> > [...]
> Take a look at the policy-based map in the sandbox. I implement
> what I called "indexed nodes" which appear to give the complexity
> characteristics you describe. I'm not sure whether the indexed_set
> library soon to be reviewed also supports this feature or not, but
> given all the other features it has, I would be suprised if it didn't. ;)

Well, currently indexed_set does not have such an index
type, although it could be probably implemented with relative
But I fail to see what this type of structure is useful
for. From what I've read on this thread, the main reason
one could want to have operator[] is that it allows the
programmer to store the index of an element for later
retrieval. But this can be also accomplished (and with better
performance) if we store an iterator or a reference to the element
instead. I guess I'm not fully understanding the use case.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Boost list run by bdawes at, gregod at, cpdaniel at, john at