Choosing arity of a template function

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 27 06:00:16 PST 2016


On 02/27/2016 07:38 AM, Marc Schütz wrote:
> I don't see it as cheating; in fact it is more elegant, because it
> checks for exactly the thing you depend on, namely that `partition` is
> callable. Your explicit check above rejects structs with opCall(), for
> example, which is probably not what you intended.

Good point. Unrelated: I also noticed that if the template has an error 
inside, the error messages when using it with __traits(compiles) are 
mightily confusing. -- Andrei


More information about the Digitalmars-d mailing list