Assert compilation failure with certain message

bearophile bearophileHUGS at lycos.com
Thu Feb 10 16:19:14 PST 2011


Tomek Sowiñski:

> Is there a way to statically assert compilation of an expression failed *with a certain message*? I want to check my static asserts trip when they should.

I have asked something like this a lot of time ago, but I don't know a way to do it. You are able to statically assert that some code doesn't compile, but I don't know how to assert that a certain message gets produced. You are asking for a specific static catch :-)

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list