assumeSorted can't access private function when compiling with -debug

FreeSlave via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 9 12:32:30 PST 2016


Here's code:


private {
     import std.algorithm;
     import std.range;
     import std.typecons;
     alias Tuple!(int, string) Data;
}

private bool myCmp(Data a, Data b) {
     return a[0] < b[0];
}

auto bar() {
     return [Data(1, "one"), Data(2, "two")].assumeSorted!myCmp;
}

void main()
{
     bar();
}

Build it with -debug and without. It gives me error when building 
with -debug.

/usr/include/dmd/phobos/std/algorithm/sorting.d(154): Error: 
function sorttest.myCmp is not accessible from module sorting

Is it bug?



More information about the Digitalmars-d-learn mailing list