Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-04-23 13:45:06


Marco wrote:
> Well, the last word is up to the author's library, however I'd be
> surprised if the following relations were not valid:
>
> associativity:
> or_< T1, or_<T2, T3> > == or_< T1, T2, T3 > == or_< or_<T1, T2,>, T3 >
> and_< T1, and_<T2, T3> > == and_< T1, T2, T3 > == and_< and_<T1, T2,>, T3 >
>
> commutativity:
> or_< T, U > == or_< U, T >
> and_< T, U > == and_< U, T >
>
> absorption:
> or_< T, and_<T, U> > == T
> and_< T, or_<T, U> > == T
>
> obviously where "==" means logical equivalence not C++ data type equality.

Yes, these relationships hold.

My only considerations wrt the proposed extensions to proto::and_ and
proto::or_ are:

1) Does it increase genericity?
2) Does it reduce bugs and/or increase discoverability in proto's interface?
3) Does it hurt compile times in the general case?

Sounds like the answers to (1) and (2) are "Yes, somewhat." I'd need to
measure to answer (3).

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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