> typeof(P.sides[0]) perimeter(P)(const ref P poly) if 
> (__traits(satisfiesConcept, perimeter, IsPolygon)) {

That's silly because the if() is called only when the template is instantiated, 
so this is a little better:

static assert(__traits(satisfiesConcept, perimeter, IsPolygon));

A problem left is that IsPolygon is not a list of things, currently it's a 
nested piece of D code for __traits(compiles).

Bye,
bearophile

Reply via email to