Getting the error from __traits(compiles, ...)

bearophile bearophileHUGS at lycos.com
Fri Nov 13 03:52:09 PST 2009


Don:

> I think you might be asking for:
> 
> static try {
>     xxx;
> }
> catch( CompilerError[] errors){
>     pragma(msg, "Failure in Frobozz!");
>     pragma(msg, errors[0].msg);
> }

Good. I'd like to have a handy&clean way to verify that some static asserts throw inside my unit tests.

Bye,
bearophile



More information about the Digitalmars-d mailing list