SortedRange.lowerBound from FrontTransversal
Alex via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Aug 6 16:00:42 PDT 2016
Hi all... a technical question from my side...
why the last line of the following gives the error?
import std.stdio;
import std.range;
import std.algorithm;
void main()
{
size_t[][] darr;
darr.length = 2;
darr[0] = [0, 1, 2, 3];
darr[1] = [4, 5, 6];
auto fT = frontTransversal(darr);
assert(equal(fT, [ 0, 4 ][]));
auto heads = assumeSorted!"a <= b"(fT);
writeln(heads.lowerBound(3)); //!(SearchPolicy.gallop)
}
The error is:
Error: template
std.range.SortedRange!(FrontTransversal!(ulong[][],
cast(TransverseOptions)0), "a <= b").SortedRange.lowerBound
cannot deduce function from argument types !()(int), candidates
are:
package.d(7807,10):
std.range.SortedRange!(FrontTransversal!(ulong[][],
cast(TransverseOptions)0), "a <=
b").SortedRange.lowerBound(SearchPolicy sp =
SearchPolicy.binarySearch, V)(V value) if
(isTwoWayCompatible!(predFun, ElementType!Range, V) &&
hasSlicing!Range)
I tried also with "assumeNotJagged" for the FrontTransversal, it
didn't worked either, beyond the fact, that assumeNotJagged is
not of interest for me...
More information about the Digitalmars-d-learn
mailing list