Bug 5345 – std.array is missing the remove functions from std.container
Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-12-12T18:04:00Z
Last change time
2015-06-09T01:31:16Z
Assigned to
nobody
Creator
issues.dlang
Comments
Comment #0 by issues.dlang — 2010-12-12T18:04:29Z
Containers in std.container implement a certain set of functions - including various remove functions. std.array currently implements the various range functions that arrays are supposed to have, but it does _not_ implement any of the container functions. In particular, it lacks the various remove functions. These functions should be added to std.array:
removeFront() (presumably just an alias for popFront())
removeBack() (presumably just an alias for popBack())
linearRemove()
removeAny() (presumably an alias for popFront())
I'm not sure if they can implement the stable versions or not, since I'm not really sure what the docs mean when they're talking about iterators given that D doesn't generally use them. I would have expected it to refer to ranges, but since an array _is_ range that could get a bit funny... In any case, whatever subset of the various remove functions would be appropriate for arrays should be added to std.array.
Comment #1 by issues.dlang — 2011-02-26T06:06:34Z
Actually. I'm not sure that we want to add these. The more I think about it, the less convinced I am that we want to treat dynamic arrays like containers. It generally makes better sense to treat them as ranges. However, since they _are_ a bit schizophrenic about whether they're ranges or containers, I'm not entirely sure what the best course is here. I _am_ leaning towards just treating them as ranges though.
Comment #2 by issues.dlang — 2012-01-20T23:13:33Z
Not a good idea. Dynamic arrays are _not_ containers. Closing.