Concepts vs template constraints - the practical approach

Norbert Nemec Norbert at Nemec-online.de
Sun Nov 20 11:38:41 PST 2011


On 20.11.2011 19:58, Denis Shelomovskij wrote:
>> void myfunction(A)(A arr)
>> if(__traits(compiles, verifyMyConcept!(A)))
>> {
>> }
>
> It should be
> ---
> void myfunction(A)(A arr)
> {
> verifyMyConcept!A;
> }
> ---
> to see the error messages.

Indeed - that way you win a meaningful error message but you loose the 
possibility for overloading. Guess, one really has to choose between the 
two... :-(




More information about the Digitalmars-d mailing list