Summary: choosing the template declaration for a template
                    instantiation involves more than partial ordering by
           Product: D
           Version: 1.045
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Keywords: spec, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

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)


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)

for a thorough description.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to