[Issue 4705] Redesign of std.algorithm.max()/min() + mins()/maxs()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 3 09:45:22 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=4705



--- Comment #17 from bearophile_hugs at eml.cc 2013-09-03 09:45:18 PDT ---
In dmd 2.064alpha you can't use minPos on a byKey range:

import std.algorithm: minPos;
void main() {
    int[int] aa = [1: 2];
    int m1 = aa.byKey.minPos!((a, b) => a > b)[0]; // errors
    int m2 = aa.keys.minPos!((a, b) => a > b)[0];
}



test.d(4): Error: template std.algorithm.minPos does not match any function
template declaration. Candidates are:
...\dmd2\src\phobos\std\algorithm.d(6436):        std.algorithm.minPos(alias
pred = "a < b", Range)(Range range) if (isForwardRange!Range &&
!isInfinite!Range && is(typeof(binaryFun!pred(range.front, range.front))))
test.d(4): Error: template std.algorithm.minPos(alias pred = "a < b",
Range)(Range range) if (isForwardRange!Range && !isInfinite!Range &&
is(typeof(binaryFun!pred(range.front, range.front)))) cannot deduce template
function from argument types !(__lambda3)(Result)
test.d(4): Error: template instance minPos!(__lambda3) errors instantiating
template

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


More information about the Digitalmars-d-bugs mailing list