[Issue 6613] New: Can't use empty tuple as default value for variadic template function parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 6 12:40:35 PDT 2011


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

           Summary: Can't use empty tuple as default value for variadic
                    template function parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2011-09-06 12:40:19 PDT ---
template Tuple(T...) { alias T Tuple; }

void f(T...)(int arg0 = 0, T argN = Tuple!());

static this() { f(); }

Compiler output:
test.d(3): Error: cannot implicitly convert expression (tuple()) of type () to
()
test.d(5): Error: template instance test.f!() error instantiating

The compiler requires a default value for argN, because it comes after another
optional argument, but it doesn't seem like an empty tuple can be specified.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list