[Issue 1759] Closures and With Statements

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 7 20:56:10 PDT 2012


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


Salih Dincer <salihdb at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |salihdb at hotmail.com
         Resolution|                            |INVALID


--- Comment #1 from Salih Dincer <salihdb at hotmail.com> 2012-08-07 20:56:08 PDT ---
This is not a bug it's a feature,
there's solution:

void main() {
  struct SS {
   int a, b, c;
  }
  int delegate () addss(SS obj){
    return {
      with(obj) return a+b+c;
    };
  }
  addss(SS(7, 10, 60))().writeln("(total numbers 77)");
}

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