Template constraints error messages using cputs()
BCS
none at anon.com
Sun Aug 8 07:37:55 PDT 2010
Hello Don,
> bearophile wrote:
>
>> 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
> pragma(msg) was NOT intended for metaprogramming. It's an accident
> that it works at all for the things people are using it for.
>
Yes but a very useful accident. And a use that ctputs doesn't match up with.
--
... <IXOYE><
More information about the Digitalmars-d
mailing list