Summary: Allow for passing values with the 'ref' keyword
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-08-06 04:50:10 PDT ---
It would be AWESOME if you could pass by-ref parameters using the ref keyword
(ditto with 'out'):

    void foo(ref int bar) { ... }
    int i = 0;
    foo(ref i);   // <------- here


    void foo(out int bar) { ... }
    int i = 0;
    foo(out i);   // <------- here

This should be an _optional_ feature, to avoid breaking code and to aide with
generics (saying 'ref' should, however, REQUIRE that the parameter be passed by



It documents the fact that you're passing something by reference, avoids bugs
where the variable is changed to be passed by value and the caller's code no
longer works, and making it optional allows everything to still work as before.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to