On Friday, 10 January 2014 at 00:52:27 UTC, H. S. Teoh wrote:

<snip>

So to summarize:
(1) use sig constraints to define the scope of an overload; and
(2) use static if inside the function body (or template body) to enforce
type requirements within that scope.

This solves the problem of needing the compiler to somehow read your mind and figure out exactly which of the 56 overloads of find() you
intended to match but failed to.


T

Ok, you've convinced me. I still think highlighting which constraints failed should happen but for well implemented modules like those in the standard library your approach offers even more helpful and tight error messages.

Reply via email to