Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-09-05 19:41:03


On Thursday 05 September 2002 06:13 pm, David Abrahams wrote:
> It's not unreasonable to think of using a rel_ops approach for these
> things, though the operators won't propagate into generic algorithms:
>
> namespace mine {
> boost::interval f(boost::interval* start, boost::interval* finish)
> {
> using boost::intervals::my_preferred_comparison_ops;
>
> ... start[0] < start[1] ... ; // ok
>
> std::sort(start, finish); // error
> };
> }

Thanks Dave! This is the only solution I've seen so far that doesn't increase
the size of my bump of trouble. It allows coexistence of different comparison
semantics without choosing a default (apparently, no good default exists),
and without unnaturally binding the type of comparison into the interval.

        Doug


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