Boost logo

Boost :

From: David Walthall (walthall_at_[hidden])
Date: 2006-08-10 11:44:57


Matias Capeletto wrote:
> * In relation with Boost.MultiIndex, Do you think that it is
> worth to have a bidirectional map library in Boost, that trades
> generality for a better specialized user interface?

Absolutely.

> * What do you think of the design of operator[]?
> Is there a better way to be coherent with the stl that does not imply
> throwing exceptions?

Have you considered making this behavior a policy? There may be
situations where a user would prefer that their bimap do something
different, such as asserting (in debug mode), or ignoring the insertion
request altogether.

An even more exotic approach to handling the collision could be to erase
the old elements. That is, when (a,b) is inserted, the policy could
specify that (a,*) and (*,b) are erased from the set before (a,b) is
inserted.

David


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