1 import bolts.range: isSortedRange; 2 3 struct A { // unsortable 4 int i; 5 } 6 7 struct B { // sortable 8 int i; 9 bool opCmp(B a) { 10 return i < a.i; 11 } 12 } 13 14 static assert( isSortedRange!([1].maybeSort)); 15 static assert(!isSortedRange!([A()].maybeSort)); 16 static assert( isSortedRange!([B()].maybeSort)); 17 static assert( isSortedRange!([A()].maybeSort!"a.i < b.i"));
0.0.1
Might or might not sort a range, depending on some static properties of a range.