[Issue 2803] New: template + default argument = doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 5 15:35:06 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2803

           Summary: template + default argument = doesn't work
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


struct S {}
ref S getS();

void fun(T, U)(T t, ref U u = getS)
{
}

void main()
{
    fun(1);
}

./test.d(10): Error: template test.fun(T,U) does not match any function
template declaration
./test.d(10): Error: template test.fun(T,U) cannot deduce template function
from argument types !()(int)


-- 



More information about the Digitalmars-d-bugs mailing list