[Issue 9102] OutputRange should be ref parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 21 06:37:04 PST 2013


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



--- Comment #3 from SHOO <zan77137 at nifty.com> 2013-02-21 06:37:03 PST ---
I think that the functions such as std.algorithm.copy or
std.format.formattedWrite should handle it definitely even if any OutputRange.
In addition, I think that the function to produce a result not to aim at though
given correct OutputRange is not good interface.

OutputRange does not have the rule except what is handed to std.range.put
function.
Therefore, OutputRange such as CRC32 is correct.
But, it is a big burden for all people defining OutputRange that define wrapper
such as CRC32OutputRange to all OutputRange that is value type having states.

Furthermore, OutputRange is intended to update a state by the data which it was
handed to, and it is necessary for most cases to update Range itself.
OutputRange should be handled with a reference type basically.

>From these, I think that it is appropriate that a function to treat OutputRange
with ref parameter.
(std.range.put takes ref in the first argument as collateral evidence.)

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