Comment #0 by kamm-removethis — 2009-07-05T00:34:56Z
The spec says
The template picked to instantiate is the one that is most specialized that fits the types of the TemplateArgumentList. Determine which is more specialized is done the same way as the C++ partial ordering rules.
and the DMD code says something else.
For instance
template Foo1(T) { pragma(msg, "type"); }
template Foo1(alias T) { pragma(msg, "alias"); }
alias Foo1!(Object) f1; // alias (type is only match-with-conversions)
but
template Foo2(T : Object) { pragma(msg, "type"); }
template Foo2(alias T) { pragma(msg, "alias"); }
alias Foo2!(Object) f2; // type (both match exactly, type is more specialized)
See http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=92613 for a thorough description.
Comment #1 by dlang-bugzilla — 2014-02-03T14:34:49Z
*** This issue has been marked as a duplicate of issue 1659 ***