Compile-time exceptions

bearophile bearophileHUGS at lycos.com
Mon Nov 24 06:04:13 PST 2008


Christopher Wright:
> assert (!is (typeof (nest(1, 1, 1)))); // int is not callable

Oh, right, that syntax isn't much elegant, but it seems to work, and it's doable. Thank you. I'll probably use it now and then.

You can use it statically too :-)
static assert (!is (typeof (nest(1, 2, 3)))); // int is not callable


>If you're using d2:<

Not yet.

Bye,
bearophile



More information about the Digitalmars-d mailing list