[Issue 17200] New: std.algorithm: add last* to minPos, maxPos, find, ...

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 19 13:59:13 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17200

          Issue ID: 17200
           Summary: std.algorithm: add last* to minPos, maxPos, find, ...
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: greeenify at gmail.com

It would be nice to have a convenient wrapper to yield the last result of the
following:

minElement
maxElement
minIndex
maxIndex
minPos
maxPos
find

While one can simply use `.retro`, this doesn't work for InputRanges.
It might be possible to build a `.last` (similar to walkBack) that abstracts
this difference away and keeps calling the method, e.g.

--


More information about the Digitalmars-d-bugs mailing list