opCast!bool

2012-01-03 Thread simendsjo
I guess this is as designed, but I'll ask anyway. http://dlang.org/operatoroverloading.html#Cast says an expression is rewritten to opCast "whenever a bool result is expected". This is true for if(e) somethingElse and e && somethingElse , but not for other parts. assert(cast(bool)e == true);

Re: opCast!bool

2012-01-03 Thread Jonathan M Davis
On Tuesday, January 03, 2012 17:41:12 simendsjo wrote: > I guess this is as designed, but I'll ask anyway. > > http://dlang.org/operatoroverloading.html#Cast says an expression is > rewritten to opCast "whenever a bool result is expected". > > This is true for > if(e) somethingElse > and e && som

Re: opCast!bool

2012-01-03 Thread Timon Gehr
On 01/04/2012 12:31 AM, Jonathan M Davis wrote: On Tuesday, January 03, 2012 17:41:12 simendsjo wrote: I guess this is as designed, but I'll ask anyway. http://dlang.org/operatoroverloading.html#Cast says an expression is rewritten to opCast "whenever a bool result is expected". This is true f

Re: opCast!bool

2012-01-03 Thread Timon Gehr
On 01/03/2012 05:41 PM, simendsjo wrote: I guess this is as designed, but I'll ask anyway. http://dlang.org/operatoroverloading.html#Cast says an expression is rewritten to opCast "whenever a bool result is expected". This is true for if(e) somethingElse and e && somethingElse , but not for ot

Re: opCast!bool

2012-01-03 Thread Jonathan M Davis
On Wednesday, January 04, 2012 00:35:20 Timon Gehr wrote: > On 01/04/2012 12:31 AM, Jonathan M Davis wrote: > > On Tuesday, January 03, 2012 17:41:12 simendsjo wrote: > >> I guess this is as designed, but I'll ask anyway. > >> > >> http://dlang.org/operatoroverloading.html#Cast says an expression