[Issue 2550] New: template specialization not working because of "static if"?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 1 00:19:24 PST 2009


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

           Summary: template specialization not working because of "static
                    if"?
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidl at 126.com


template pow10(long n)
{
        static if(n<0)
                const long pow10=0;
        else
                const long pow10=10*pow10!(n-1);
}

template pow10(long n:0)
{
        const long pow10=1;
}

static assert(pow10!(0) == 1);


-- 



More information about the Digitalmars-d-bugs mailing list