Bug 7145 – Implement initializedArray in std.array

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-12-20T10:40:00Z
Last change time
2016-08-27T22:24:51Z
Assigned to
nobody
Creator
andrej.mitrovich

Attachments

IDFilenameSummaryContent-TypeSize
1056initArray.dinitArraytext/x-dsrc1356
1057initArray.dinitArray2text/x-dsrc1509
1058initArray.d3rd versiontext/x-dsrc2463

Comments

Comment #0 by andrej.mitrovich — 2011-12-20T10:40:45Z
Created attachment 1056 initArray It would be nice to have an initializedArray function, which creates and initializes an arbitrarily-sized array with a *specific* initializer. An implementation is provided in the attachment.
Comment #1 by andrej.mitrovich — 2011-12-20T11:16:09Z
Created attachment 1057 initArray2 Rebased initArry to dsimcha's initialize() function from his std.allocator package.
Comment #2 by andrej.mitrovich — 2011-12-20T12:28:53Z
Created attachment 1058 3rd version This one adds initialization by another array's elements. Basically it's a deep-copy.
Comment #3 by andrej.mitrovich — 2016-08-27T22:24:51Z
Hmm.. I'm not sure about the use-case of this. It combines some stuff with an optional allocator but that should ideally be part of the new allocator stuff in the works by Andrei. The provided example implementation isn't very noteworthy though. Closing this.