ch-ch-changes

Daniel Keep daniel.keep.lists at gmail.com
Wed Jan 28 16:44:31 PST 2009



Christopher Wright wrote:
> Don wrote:
>> [snip]
>>
>> Then we get:
>> static assert(__traits(mixincompiles, comp), "Predicate: " ~ comp ~ "
>> does not compile");
>>
>> mxin(comp);
> 
> That's certainly prettier.

Still doesn't give the user a reason for WHY their predicate didn't
compile...

It's a pity we can't do this (or something similar):

template Something(string comp)
{
    static assert( __traits(mixincompiles, comp),
        "Predicate q{"~comp~"} does not compile, because:\n"
        ~__traits(mixinerrors, comp,
                  Something.instantiationFile,
                  Something.instantiationLine) );
}

  -- Daniel



More information about the Digitalmars-d mailing list