Boost logo

Boost :

Subject: Re: [boost] Boost.Algorithm design question
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-10-30 14:15:34

Dave Abrahams wrote:
> Actually it needs a bit more than that: applying ! to your bool-ish
> thing needs to be unambiguously &&-able with the result of i != j, which
> might not itself be bool.

That's part of what bool-ish means. For two bool-ish values x and y, x&&y
should be bool-ish and

(x&&y?true:false) == (x?true:false)&&(y?true:false)

and similarly for ! and ||. (Note that x and y need not be of the same
type.) I don't mind requiring a bool return for op== though, to avoid these
gymnastics. :-)

Boost list run by bdawes at, gregod at, cpdaniel at, john at