Overload of ! operator

Jonathan M Davis jmdavisProg at gmx.com
Tue Jun 25 22:24:13 PDT 2013


On Wednesday, June 26, 2013 07:14:36 cal wrote:
> But that code I posted does work, and gives the output shown. Am
> I misunderstanding?

Then my understanding of how ! is handled is wrong. Apparently !s does get 
replaced with !cast(bool)s, or it couldn't work. But note that

bool b = s;

doesn't work, so as I said, it's not the case that opCast gives you an 
implicit cast. It's just the cases where cases where the compiler inserts an 
explicit cast for you that it looks like it gives you an implicit cast. But 
apparently, there was a case that it inserts an explicit cast of which I was 
not aware.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list