Should out/ref parameters require the caller to specify out/ref like in C#?
Nick Sabalausky (Abscissa) via Digitalmars-d
digitalmars-d at puremagic.com
Sun May 28 18:49:15 PDT 2017
That's what C# does. I always liked that a lot, and even argued in favor
of doing the same in D (ages ago). It got shot down way back when, so
unfortunately, I don't think any reversal is going to happen.
Getting in the way of UFCS and generic code are fair points, although
they don't stike me as insurmountable. I think that if D's ref/out
params had worked that way from the beginning we would've already hod
solutions to those matters. And it does kinda bug me when generic code
ends up being a reason to not have a nice benefitial feature for
non-generic code, just fwiw :(
In response to any claim that this isn't a real problem in practice, I
submit the possibility that, if it indeed isn't a real problem, maybe
that's *because* of people (like Stefan and ketmar) simply avoiding the
feature entirely so that it *doesn't* become a problem.
More information about the Digitalmars-d
mailing list