On 11/20/2013 08:49 AM, Jacob Carlborg wrote:
Would we accompany the assumeSorted with an assert in the function assuming something is sorted? We probably don't want to rely on convention.
We do in any case:
import std.algorithm, std.range;
void main(){
auto a = [1,2,3,4,5];
auto s = sort(a);
swap(a[0],a[$-1]);
assert(is(typeof(s)==SortedRange!(int[])) && !s.isSorted());
}
