Template constraints error messages using cputs()

bearophile bearophileHUGS at lycos.com
Sat Aug 7 20:53:33 PDT 2010


BCS:
> One solution to this issue would be to have an unconstrained temple that 
> contains nothing but prgam(msg,"...") inside static ifs. That way failing 
> the constraint produces a nice message and then, because the template has 
> nothing it it, using it for almost anything will generate an error and block 
> compilation.

I will try this solution, thank you. But cputs will be useful regardless. You can usually find a twisted way to solve most problems, but keeping pragms(msg) in D is not good, it's a temporary solution at best. One of the 'temporary solutions' in D that risks to stick around forever, I fear.

Bye,
bearophile


More information about the Digitalmars-d mailing list