
30 Oct
2011
30 Oct
'11
6:15 p.m.
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. :-)