[Issue 23352] `in` and `out` foreach variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 22 14:13:04 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23352

--- Comment #3 from Bolpat <qs.il.paperinik at gmail.com> ---
(In reply to elpenguino+D from comment #1)
> What is `out` supposed to be used for here? It seems like it'd be identical
> to `ref` in this context.

In the simplest terms, you’re supposed to assign to an `out` variable. The D
language does not enforce it, but e.g. C# does. D’s out is quite useless, it’s
documenting intent more than anything. Besides that, you’re guaranteed that the
object referred to is in its init state.

--


More information about the Digitalmars-d-bugs mailing list