[Issue 4664] New: Lambdas default arguments problems

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 17 07:15:32 PDT 2010


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

           Summary: Lambdas default arguments problems
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-08-17 07:15:28 PDT ---
In C++0x default arguments are not allowed in lambdas. In D2 they are allowed,
but this program shows (compiled with dmd 2.048) that they have problems:


import std.stdio: writeln;
void foo(T)(T callme) {
    callme();
}
void main() {
    auto lam1 = (int x=5){ writeln(x); };
    auto lam2 = (int x=10){ writeln(x); };
    foo(lam1);
    foo(lam2);
}



Output:
5
5


Is it positive to disallow default arguments in D2 lambdas too?

-- 
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