Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-04-24 06:31:35


John Reid ha escrito:

> Travis Parks wrote:
> > I have always been interested in a data structure for storing pairs of
> > of keys. In math it is a one-to-one mapping. I find it useful from
> > time to time to have a container that allows me to treat it like an
> > enum, but then to do the operation the other way. I usually do it
> > lazily and just do a map and then do a linear search for the value
> > when I need to.
> >
>
> Look at http://www.boost.org/libs/multi_index/doc/index.html this does
> all you want.

Also, there's the more specific Boost.Bimap library (accepted some weeks
ago) for explicitly constructing bidirectional mapping structures:

http://cablemodem.fibertel.com.ar/mcape/oss/projects/mc_projects/boost_projects/boost_bimap.html

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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net