I just saw that the target range passed to std.algorithm.copy is not passed by reference. So for a range which is implemented as a simple struct value type and which modifies some internal state a call to copy does not have any effect. It can be worked around by passing a pointer to that range instead of the range itself, but is there any reason why we can't just add a 'ref' to the target range parameter?
- std.algorithm.copy target not passed by reference (bug?) Johannes Pfau