Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-08-05 11:25:03


At Tuesday 2002/07/30 20:23, you wrote:
>Ok... my schedule precludes this from happening before the weekend unless
>some unusual things happen at my client's.
>I'll see where I can get by then.
>At Monday 2002/07/29 11:11, you wrote:
>
>>That's a good start. Why don't you finish fleshing this out in C++.
>>
>>BTW, it would be nice if I could implement this "set" interface for
>>dynamic_bitset without conflicting with current operations. For example,
>>operator<= is already taken to mean lexicographically less or equal.
>>However, if that leads to too much ugliness, we can always go the adaptor
>>route.

my schedule precluded my doing any serious coding on this, but I did
(finally at 0100 this morning) get a chance to actually look at the
implementation of dynamic_bitset.

If there are people who see some "lexicographic" ordering to the elements
of a set, then we've got some differences to address. From my point of
view, all the elements in a set are of "equal importance" and the < and >
operators should return the same results independent of the underlying
implementation.

With that in mind, it appears that one could simply have operator <=()
(and >=() with the args reversed) call is_subset_of() and have operator <()
(>() ditto above) call is_proper_subset().

The operators |=() and &=() appear to be already implemented.

The only remaining thing to be handled would then be operator -=() and
operator -() (possibly both the unary and binary flavors).

NOTE: these changes will ALTER the behavior of the any current code which
counts on there being some lexicographic meaning in dynamic_bitset.

Should it be determined that lexicographic comparisons have utility, then
mayhaps we should abandon attempts to map C++ "set" onto the mathematical
set concept.
Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
               "There oughta be a law"


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