Bug 5170 – std.algorithm.copy "works" for non-assignable ranges

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-11-05T10:03:00Z
Last change time
2011-04-12T17:44:35Z
Keywords
accepts-invalid
Assigned to
andrei
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2010-11-05T10:03:26Z
The following code compiles and runs (??????) import std.algorithm; struct DummyRange { int front() { return 1; } void popFront() {} enum bool empty = false; } void main() { auto arr = [1,2,3]; DummyRange dummyRange; copy(arr, dummyRange); }
Comment #1 by dsimcha — 2011-04-12T17:44:35Z
This one looks to have been fixed a long time ago but never closed.