Bug 3002 – toArray or eager for ranges

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-05-17T11:10:00Z
Last change time
2015-06-09T01:27:59Z
Assigned to
bugzilla
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2009-05-17T11:10:12Z
Andrei had proposed a while back on the NG when ranges were first being discussed to include a toArray() or eager() function that takes an arbitrary finite range and turns it into an array. This apparently was overlooked in the final design, but would be simple to implement and very useful. One request: If the range defines a length, it should be pre-allocated rather than using appending.
Comment #1 by andrei — 2009-05-17T19:53:36Z
It's coming with the next Phobos.