http://d.puremagic.com/issues/show_bug.cgi?id=9102
Summary: OutputRange should be ref parameter
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from SHOO <[email protected]> 2012-12-01 22:35:18 PST ---
This code doesn't work:
----------------------
import std.algorithm, std.digest.crc;
void main()
{
CRC32 crcA, crcB;
const ubyte[] ary3 = [1,2,3,4];
copy(ary3, crcA);
copy(ary3, &crcB);
assert(crcA.finish() == crcB.finish());
}
----------------------
The second parameter of copy is non-ref OutputRange. This will be broken by
receiving OutputRange which is a non-reference type.
Like std.range.put, it is necessary to make ref parameter.
Some similar cases appear elsewhere. (eg. formattedWrite
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------