Thread overview
[Issue 5345] New: std.array is missing the remove functions from std.container
Dec 13, 2010
Jonathan M Davis
Feb 26, 2011
Jonathan M Davis
Jan 21, 2012
Jonathan M Davis
December 13, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5345

           Summary: std.array is missing the remove functions from
                    std.container
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: jmdavisProg@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg@gmx.com> 2010-12-12 18:04:29 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 26, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5345



--- Comment #1 from Jonathan M Davis <jmdavisProg@gmx.com> 2011-02-26 06:06:34 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 21, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5345


Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


--- Comment #2 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-01-20 23:13:33 PST ---
Not a good idea. Dynamic arrays are _not_ containers. Closing.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------