[Issue 2877] New: suggest keyword:auto return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 22 05:48:51 PDT 2009


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

           Summary: suggest keyword:auto return
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: galaxylang at gmail.com


I'm interest in D's metaprogram,surely D is the most powerful language now.
However when i write D program,i found if we can program by this way:

auto ReturnStatic(int i)(int a)
{
   int f1(int b){return a+b;}
   double f2(double c){return c+a;}
   static if(i==0){return &f1;}
   else return &f2;
}

this will be great enhance the language power


-- 



More information about the Digitalmars-d-bugs mailing list