[Issue 22873] Wrong std.format output for `inout`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 11 18:32:42 UTC 2022


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

--- Comment #2 from johanengelen at weka.io ---
Paul Backus wrote on Slack:
Yes, this is an easy pit to fall into. In order to work correctly with inout,
dummy variables like the one in hasToString need to be declared as parameters,
not locals. See e.g. std.range.isInputRange, which gets this right:
https://github.com/dlang/phobos/blob/v2.099.0/std/range/primitives.d#L174

--


More information about the Digitalmars-d-bugs mailing list