Bug 18806 – minIndex should be able to take an input range but does not
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-04-28T03:26:35Z
Last change time
2019-03-14T04:00:46Z
Keywords
pull
Assigned to
No Owner
Creator
Matthew Gamble
Comments
Comment #0 by gamblemj — 2018-04-28T03:26:35Z
maxIndex claims to work with an input range, but does not. Under the hood, maxIndex just calls minIndex with the params to the comparison reversed. However minIndex only accepts forward ranges and so errors if maxIndex (or minIndex) is called with an input range. Looking at the code for minIndex I cannot see why it couldn't accept an input range. This may be an easy fix, unless I'm not grasping something.
@Vasniktel updated dlang/phobos pull request #6899 "Fix for the issue 18806: InputRange for std.algorithm.minIndex" fixing this issue:
- Fix Issue 18806 - InputRange for std.algorithm.minIndex
https://github.com/dlang/phobos/pull/6899
Comment #3 by dlang-bot — 2019-03-14T04:00:46Z
dlang/phobos pull request #6899 "Fix for the issue 18806: InputRange for std.algorithm.minIndex" was merged into master:
- 5795db7ab7718b1a7d73cdae6fb04ad9fd60fb86 by Vasyl Teliman:
Fix Issue 18806 - InputRange for std.algorithm.minIndex
https://github.com/dlang/phobos/pull/6899