[Issue 6442] Allow for passing values with the 'ref' keyword

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 7 00:45:05 PDT 2011


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



--- Comment #19 from wfunction at hotmail.com 2011-08-07 00:45:04 PDT ---
> The fact that it's ref now instead of out has no effect on the calling function.

Yeah it does -- the caller now has to initialize it with something sensible
first.
Furthermore, the caller is no longer guaranteed that the variable will be
initialized _after_ the call -- it could very well remain untouched.

If the caller doesn't really care, though, he could omit it altogether -- the
benefit of making it optional.


The problem with making this required would be that it would mess up templates,
auto ref, etc... it just doesn't work for D. But making it optional would let
the caller choose whether he wants the easy path or the safe path, without
breaking anything.

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