Boost logo

Boost Users :

From: Lukasz Dobrek (dobrek_at_[hidden])
Date: 2006-09-20 07:10:39


Hi,
I know that there are for sure important design decisions explaining why
all std containers as well as multiindex take a comparison operator,
as template
parameter. This behavior is satisfactory as long, as comparison is
sort of context
independent. The best example say ints, but there exist cases when comparison
of two object requires some priory knowledge about context this
objects exist in.
My favorite example is tenor ( time period ). It is impossible to say whether
1 month is less then 30 days unless you know when you start counting.
So in order to compare such objects I need to specify some anchor date.
Unfortunately I cannot have a std::set of such objects, nor a multiindex
indexed with this objects.

Note: I am able to sort a vector of such objects using std::sort.

First question: Is there a way to use such objects with multiindex, if not why?
Second question: I cannot be the only bloke disturbed by this issue,
how are you dealing with it?

Regards,
Lukasz Dobrek


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