On 06/07/2016 08:50 PM, ParticlePeter wrote:
On Tuesday, 7 June 2016 at 14:31:40 UTC, Alex Parrill wrote:
I don't think opCast gets called for implicit conversions; it only
gets called for explicit casts. I'll test it later.

It does for type bool, but I fear that's the only exception.

No, opCast can't be used for implicit conversions to bool.

I guess you're thinking of the `if(foo) {...}` case. That's considered an explicit conversion. `bool b = foo;` still won't work.

Reply via email to