Boost logo

Boost :

From: Carl Daniel (cpdaniel_at_[hidden])
Date: 2002-09-01 20:05:05


I'm just starting to review the library, but one idea which popped into my
head, based on something I did years ago, is that of including some extended
logical operations to compliment interval comparisons.

If one orders the internal comparision results as
{false,indeterminate,true}, then there is a sensible definition for all of
the common logic operations (assume false -> true correspond to values 0, 1,
2):

a AND B = min(a,b)
a OR b = max(a,b)
NOT a = 2-a

XOR can be implemented via table, or by it's basic definition:

a XOR b = (a AND NOT b) OR (b AND NOT a)

Would that be a useful addition to the library? I suppose it would require
that the relational operators return a UDT to allow overloading (perhaps
they do already? I haven't even looked yet).

-cd


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