Christopher Wright wrote:
grauzone wrote:
Look at this for example:
 > writefln("%s", is(typeof(rtzx) == char));
This compiles even if rtzx doesn't exist. But you probably wanted to check the type of rtzx, not it if rtzx exists. If you mistyped rtzx, the compiler will never tell you.

You can do 'is(typeof(rtzx)) && is(typeof(rtzx) == char)', or wrap it in a template.

The first is() in your expression is completely redundant, though. Not sure what you mean.

Anyway, my point was not about what's possible, but that it leads to not very robust code. Besides, you can't even tell what exactly went wrong inside the is(), because the compiler (of course) doesn't emit any error messages if that code isn't compileable.

Reply via email to