Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-02-27 04:35:02


Matias Capeletto wrote:
> (3) (from other thread) For bm (the above view) we have some options:
>
> a) bm can be left without any special function and so force the user
> to write .left or .right to refer to it.
> b) bm can be the same as bm.left. This IMHO introduce an asymmetry to
> the interface. The left view became the more important than the right
> view.

Don't like this much.

> c) bm can be used for something new. Give the user a new view of the
> mapping: a set of relations. This design is symmetric. It forces the
> user to write .left to refer to the std::map<X,Y> view but this is a
> good thing, because is documented in the code what view is being used.
> This option is more elegant and powerful that the other ones.
> Because it is a new view we can use the symmetric left/right notation
> for
> it members so the design is complete. If we use first and second, the
> above view could be confused with the left view.

Nod, we definitely want the set of relations view I think, the question is
whether this is the view offered by the bimap, or whether you access it via
a member, so we have:

bimap.left - left map view
bimap.right - right map view
bimap.relation - relation set view.

But otherwise no special members in bimap itself. In fact the more I think
about this the more I like it, but I'd like to here what others think.

John.


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