@@ -78,7 +78,7 @@ module std.algorithm.sorting;
7878import std.algorithm.mutation : SwapStrategy;
7979import std.functional : unaryFun, binaryFun;
8080import std.range.primitives ;
81- import std.typecons : Flag, No;
81+ import std.typecons : Flag, Yes, No;
8282// FIXME
8383import std.meta : allSatisfy;
8484import std.range : SortedRange;
@@ -747,7 +747,9 @@ if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range)
747747 assert (a == [ 42 , 42 ]);
748748
749749 import std.algorithm.iteration : map;
750+ import std.array : array;
750751 import std.random ;
752+ import std.range : iota;
751753 import std.stdio ;
752754 auto s = unpredictableSeed;
753755 auto g = Random (s);
@@ -1059,6 +1061,7 @@ if (isRandomAccessRange!Range && !isInfinite!Range &&
10591061@safe unittest
10601062{
10611063 import std.algorithm.comparison : equal;
1064+ import std.range : iota;
10621065
10631066 ubyte [256 ] index = void ;
10641067 iota(256 ).makeIndex(index[]);
@@ -1540,7 +1543,8 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r)
15401543@safe unittest
15411544{
15421545 import std.algorithm.comparison : equal;
1543- import std.range ;
1546+ import std.array : array;
1547+ import std.range : indexed, iota, retro;
15441548
15451549 static struct Point { int x, y; }
15461550 auto pts1 = [ Point(5 , 6 ), Point(1 , 0 ), Point(5 , 7 ), Point(1 , 1 ), Point(1 , 2 ), Point(0 , 1 ) ];
@@ -1787,6 +1791,7 @@ private void sort5(alias lt, Range)(Range r)
17871791{
17881792 import std.algorithm.iteration : permutations;
17891793 import std.algorithm.mutation : copy;
1794+ import std.range : iota;
17901795
17911796 int [5 ] buf;
17921797 foreach (per; iota(5 ).permutations)
@@ -1928,6 +1933,9 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
19281933{
19291934 // Simple regression benchmark
19301935 import std.algorithm.iteration , std.algorithm.mutation , std.random ;
1936+ import std.array : array;
1937+ import std.range : iota;
1938+
19311939 Random rng;
19321940 int [] a = iota(20148 ).map! (_ => uniform(- 1000 , 1000 , rng)).array;
19331941 static uint comps;
@@ -3439,6 +3447,8 @@ done:
34393447
34403448@safe unittest
34413449{
3450+ import std.array : array;
3451+
34423452 auto a = [ 10 , 5 , 3 , 4 , 8 , 11 , 13 , 3 , 9 , 4 , 10 ];
34433453 assert (expandPartition! ((a, b) => a < b)(a, 4 , 5 , 6 ) == 9 );
34443454 a = randomArray;
@@ -3453,7 +3463,10 @@ private T[] randomArray(Flag!"exactSize" flag = No.exactSize, T = int)(
34533463 T minValue = 0 , T maxValue = 255 )
34543464{
34553465 import std.algorithm.iteration : map;
3466+ import std.array : array;
34563467 import std.random : unpredictableSeed, Random , uniform;
3468+ import std.range : iota;
3469+
34573470 auto size = flag == Yes.exactSize ? maxSize : uniform(1 , maxSize);
34583471 return iota (0 , size).map! (_ => uniform(minValue, maxValue)).array;
34593472}
0 commit comments