Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-08-06 17:39:51


Hi Dave,

dynamic_bitset::operator< is lexicographical ordering, and I don't plan on
changing that, mostly for the reason you described below, of wanting < to
be a total ordering. A few days ago I added the functions
is_proper_subset_of() and is_subset_of() to dynamic_bitset.

Needless to say, if people want a nice set notation with < and <=, then an
adapter can be created for dynamic_bitset.

Cheers,
Jeremy

On Tue, 6 Aug 2002, Dave Harris wrote:
brangd>
brangd> Some kind of total ordering can be handy when using STD algorithms and
brangd> containers which expect it. For example, std::map (or std::set for that
brangd> matter). In this situation we don't much care what the order actually is.
brangd> We are using it as the moral equivalent of a hash() function. So it can
brangd> depend on the implementation. A lexical ordering will do.
brangd> is_proper_subset() won't, because it is not a total order.
brangd>
brangd> That is an argument for something like lexical_order(), or perhaps less().
brangd> I suppose you could still have operator<() map to is_proper_subset(), but
brangd> I would find that surprising.
brangd>
brangd> -- Dave Harris

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


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