[Issue 14420] New: partial template ordering with specialization and different arities seems broken
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Apr 7 00:47:41 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14420
Issue ID: 14420
Summary: partial template ordering with specialization and
different arities seems broken
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: code at dawg.eu
void foo(string op:"+", T)(ref T val, T mod)
{
}
void foo(string op, T, V1)(ref T val, V1 mod)
{
}
void main()
{
int i32 = 12;
foo!"+"(i32, 13); // should match first
ubyte u8;
foo!"+"(u8, 1); // not sure about this one
}
---
Maybe my intuition is wrong here, but it's surprising that the first template
function which is specialized for op:"+" isn't called.
--
More information about the Digitalmars-d-bugs
mailing list