www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2877] New: suggest keyword:auto return

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: galaxylang 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


-- 
Apr 22 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2877


fvbommel wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE
            Summary|suggest keyword:auto return |suggest keyword:auto return




------- Comment #1 from fvbommel wxs.nl  2009-04-22 07:56 -------


*** This bug has been marked as a duplicate of 2876 ***


-- 
Apr 22 2009