www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5226] New: indexOf() which takes a pred but no needle

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5226

           Summary: indexOf() which takes a pred but no needle
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            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-11-16 16:22:17
PST ---
Currently, std.algorithm has an indexOf() function which takes an optional
predicate (as a template parameter), a range, and a needle. I think that we
should have a version that takes the predicate and a range but no needle, using
only the predicate to find the index that you're looking for. In many ways,
indexOf() is indentical to find() in terms of what it's for except that find()
returns the remainder of the range and indexOf() returns where in the range
what you're trying to find is, so indexOf()'s flexibility should be closer to
find()'s (except insomuch as differences in the range types that they take
affect them).

In any case, a version of indexOf() which takes no needle but just the
predicate and the range would be a very useful addition to Phobos.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5226


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 09 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5226


Andrei Alexandrescu <andrei erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from Andrei Alexandrescu <andrei erdani.com> 2013-03-09 19:16:46
PST ---
Now countUntil took over that role.

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