Boost logo

Boost :

From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-07-12 15:56:54


"David B. Held" wrote:
>
> >Am I solving the wrong problem? I'm trying to design a dictionary with
> >these properties:
> >
> >* the internal representation is a sorted vector of pair<key, value>
> >* iterators are not invalidated by insert/erase
>
> Why does the internel representation need to be a vector? What's
> wrong with std::map?

Acording to various measurements (most notably by Matt Austern, IIRC), a
sorted vector is often much faster than a map.

Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

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