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: nob...@puremagic.com ReportedBy: jmdavisp...@gmx.com --- Comment #0 from Jonathan M Davis <jmdavisp...@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: -------