Bug 11951 – formattedWrite should take OutputRange should be ref parameter

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-19T07:27:04Z
Last change time
2018-01-17T02:14:34Z
Assigned to
No Owner
Creator
Tobias Pankrath
Depends on
9102

Comments

Comment #0 by tobias — 2014-01-19T07:27:04Z
formattedWrite should take its output range parameter by ref. See also: #10291 and #9102 Rational: To copy a range is only defined using .save for forward ranges and makes no sense for output ranges in the general case and shouldn't be done implicitly. Writing output ranges with state (for example an indenter, that inserts tabs on newline and forwards its input to another range) should not require an extra indirection if written using a struct. http://forum.dlang.org/thread/[email protected]#post-wbvdkmqsxrimuipufdix:40forum.dlang.org
Comment #1 by jack — 2018-01-17T02:14:34Z