Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions std/algorithm/comparison.d
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
module std.algorithm.comparison;

// FIXME
import std.functional; // : unaryFun, binaryFun;
import std.functional : unaryFun, binaryFun;
import std.range.primitives;
import std.traits;
// FIXME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed?

import std.meta : allSatisfy;
import std.typecons; // : tuple, Tuple, Flag, Yes;
import std.typecons : tuple, Tuple, Flag, Yes;

/**
Find `value` _among `values`, returning the 1-based index
Expand Down
2 changes: 1 addition & 1 deletion std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
module std.algorithm.iteration;

// FIXME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

import std.functional; // : unaryFun, binaryFun;
import std.functional : unaryFun, binaryFun;
import std.range.primitives;
import std.traits;

Expand Down
2 changes: 1 addition & 1 deletion std/algorithm/mutation.d
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module std.algorithm.mutation;
import std.range.primitives;
import std.traits : isArray, isBlitAssignable, isNarrowString, Unqual, isSomeChar;
// FIXME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

import std.typecons; // : tuple, Tuple;
import std.typecons : tuple, Tuple;

// bringToFront
/**
Expand Down
4 changes: 2 additions & 2 deletions std/algorithm/searching.d
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
module std.algorithm.searching;

// FIXME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll stop here, just remove all unneeded comments.

import std.functional; // : unaryFun, binaryFun;
import std.functional : unaryFun, binaryFun;
import std.range.primitives;
import std.traits;
// FIXME
import std.typecons; // : Tuple, Flag, Yes, No;
import std.typecons : Tuple, tuple, Flag, Yes, No;

/++
Checks if $(I _all) of the elements verify `pred`.
Expand Down
6 changes: 3 additions & 3 deletions std/algorithm/setops.d
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ module std.algorithm.setops;
import std.range.primitives;

// FIXME
import std.functional; // : unaryFun, binaryFun;
import std.functional : unaryFun, binaryFun;
import std.traits;
// FIXME
import std.meta; // : AliasSeq, staticMap, allSatisfy, anySatisfy;
import std.meta : AliasSeq, staticMap, allSatisfy, anySatisfy;

import std.algorithm.sorting; // : Merge;
import std.algorithm.sorting : Merge;
import std.typecons : No;

// cartesianProduct
Expand Down
23 changes: 18 additions & 5 deletions std/algorithm/sorting.d
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
module std.algorithm.sorting;

import std.algorithm.mutation : SwapStrategy;
import std.functional; // : unaryFun, binaryFun;
import std.functional : unaryFun, binaryFun;
import std.range.primitives;
import std.typecons : Flag;
import std.typecons : Flag, Yes, No;
// FIXME
import std.meta; // : allSatisfy;
import std.range; // : SortedRange;
import std.meta : allSatisfy;
import std.range : SortedRange;
import std.traits;

/**
Expand Down Expand Up @@ -747,7 +747,9 @@ if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range)
assert(a == [ 42, 42 ]);

import std.algorithm.iteration : map;
import std.array : array;
import std.random;
import std.range : iota;
import std.stdio;
auto s = unpredictableSeed;
auto g = Random(s);
Expand Down Expand Up @@ -1059,6 +1061,7 @@ if (isRandomAccessRange!Range && !isInfinite!Range &&
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range : iota;

ubyte[256] index = void;
iota(256).makeIndex(index[]);
Expand Down Expand Up @@ -1537,7 +1540,8 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r)
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range;
import std.array : array;
import std.range : indexed, iota, retro;

static struct Point { int x, y; }
auto pts1 = [ Point(5, 6), Point(1, 0), Point(5, 7), Point(1, 1), Point(1, 2), Point(0, 1) ];
Expand Down Expand Up @@ -1784,6 +1788,7 @@ private void sort5(alias lt, Range)(Range r)
{
import std.algorithm.iteration : permutations;
import std.algorithm.mutation : copy;
import std.range : iota;

int[5] buf;
foreach (per; iota(5).permutations)
Expand Down Expand Up @@ -1925,6 +1930,9 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
{
// Simple regression benchmark
import std.algorithm.iteration, std.algorithm.mutation, std.random;
import std.array : array;
import std.range : iota;

Random rng;
int[] a = iota(20148).map!(_ => uniform(-1000, 1000, rng)).array;
static uint comps;
Expand Down Expand Up @@ -3436,6 +3444,8 @@ done:

@safe unittest
{
import std.array : array;

auto a = [ 10, 5, 3, 4, 8, 11, 13, 3, 9, 4, 10 ];
assert(expandPartition!((a, b) => a < b)(a, 4, 5, 6) == 9);
a = randomArray;
Expand All @@ -3450,7 +3460,10 @@ private T[] randomArray(Flag!"exactSize" flag = No.exactSize, T = int)(
T minValue = 0, T maxValue = 255)
{
import std.algorithm.iteration : map;
import std.array : array;
import std.random : unpredictableSeed, Random, uniform;
import std.range : iota;

auto size = flag == Yes.exactSize ? maxSize : uniform(1, maxSize);
return iota(0, size).map!(_ => uniform(minValue, maxValue)).array;
}
Expand Down
8 changes: 5 additions & 3 deletions std/ascii.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ module std.ascii;
version (unittest)
{
// FIXME: When dmd bug #314 is fixed, make these selective.
import std.meta; // : AliasSeq;
import std.range; // : chain;
import std.traits; // : functionAttributes, FunctionAttribute, isSafe;
import std.meta : AliasSeq;
import std.range : chain;
import std.traits : functionAttributes, FunctionAttribute, isSafe;
}


Expand Down Expand Up @@ -675,6 +675,8 @@ if (is(C : dchar))

@safe unittest //Test both toUpper and toLower with non-builtin
{
import std.traits : OriginalType;

//User Defined [Char|Wchar|Dchar]
static struct UDC { char c; alias c this; }
static struct UDW { wchar c; alias c this; }
Expand Down
2 changes: 1 addition & 1 deletion std/experimental/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Authors: $(HTTP erdani.org, Andrei Alexandrescu),
*/
module std.experimental.typecons;

import std.meta; // : AliasSeq, allSatisfy;
import std.meta : AliasSeq, allSatisfy;
import std.traits;

import std.typecons : Tuple, tuple, Bind, DerivedFunctionType, GetOverloadedMethods;
Expand Down
4 changes: 2 additions & 2 deletions std/functional.d
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Distributed under the Boost Software License, Version 1.0.
*/
module std.functional;

import std.meta; // AliasSeq, Reverse
import std.traits; // isCallable, Parameters
import std.meta : AliasSeq, Reverse;
import std.traits : isCallable, Parameters;


private template needOpCallAlias(alias fun)
Expand Down
4 changes: 2 additions & 2 deletions std/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static import core.math;
static import core.stdc.math;
static import core.stdc.fenv;
import std.range.primitives : isInputRange, ElementType;
import std.traits; // CommonType, isFloatingPoint, isIntegral, isSigned, isUnsigned, Largest, Unqual
import std.traits : CommonType, isFloatingPoint, isIntegral, isNumeric, isSigned, isUnsigned, Largest, Unqual;

version(LDC)
{
Expand Down Expand Up @@ -175,7 +175,7 @@ else

version(unittest)
{
import core.stdc.stdio; // : sprintf;
import core.stdc.stdio : sprintf;

static if (real.sizeof > double.sizeof)
enum uint useDigits = 16;
Expand Down
3 changes: 2 additions & 1 deletion std/net/isemail.d
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
module std.net.isemail;

// FIXME
import std.range.primitives; // : ElementType;
import std.range.primitives : back, ElementType, front, empty, popFront;
import std.regex;
import std.traits;
import std.typecons : Flag, Yes, No;
Expand Down Expand Up @@ -1821,6 +1821,7 @@ if (is(Unqual!(ElementType!(S1)) == dchar) && is(Unqual!(ElementType!(S2)) == dc
ElementType!(A) pop (A) (ref A a)
if (isDynamicArray!(A) && !isNarrowString!(A) && isMutable!(A) && !is(A == void[]))
{
import std.range.primitives : popBack;
auto e = a.back;
a.popBack();
return e;
Expand Down
14 changes: 10 additions & 4 deletions std/range/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ public import std.range.interfaces;
public import std.range.primitives;
public import std.typecons : Flag, Yes, No;

import std.meta; // allSatisfy, staticMap
import std.traits; // CommonType, isCallable, isFloatingPoint, isIntegral,
// isPointer, isSomeFunction, isStaticArray, Unqual
import std.meta : allSatisfy, staticMap;
import std.traits : CommonType, isCallable, isFloatingPoint, isIntegral,
isPointer, isSomeFunction, isStaticArray, Unqual;


/**
Expand Down Expand Up @@ -3397,12 +3397,13 @@ private struct Generator(Fun...)
static assert(isInputRange!Generator);

private:
import std.traits : FunctionAttribute, functionAttributes, ReturnType;
static if (is(Fun[0]))
Fun[0] fun;
else
alias fun = Fun[0];

enum returnByRef_ = (functionAttributes!fun & FunctionAttribute.ref_) ? true : false;
enum returnByRef_ = functionAttributes!fun & FunctionAttribute.ref_;
static if (returnByRef_)
ReturnType!fun *elem_;
else
Expand Down Expand Up @@ -5670,6 +5671,8 @@ pure @safe unittest

pure nothrow @nogc @safe unittest
{
import std.traits : Signed;

//float overloads use std.conv.to so can't be @nogc or nothrow
alias ssize_t = Signed!size_t;
assert(iota(ssize_t.max, 0, -1).length == ssize_t.max);
Expand Down Expand Up @@ -11218,6 +11221,7 @@ private struct Bitwise(R)
if (isInputRange!R && isIntegral!(ElementType!R))
{
private:
import std.traits : Unsigned;
alias ElemType = ElementType!R;
alias UnsignedElemType = Unsigned!ElemType;

Expand Down Expand Up @@ -11533,6 +11537,7 @@ if (isInputRange!R && isIntegral!(ElementType!R))
@safe pure nothrow unittest
{
import std.internal.test.dummyrange;
import std.meta : AliasSeq;

alias IntegralTypes = AliasSeq!(byte, ubyte, short, ushort, int, uint,
long, ulong);
Expand Down Expand Up @@ -11628,6 +11633,7 @@ if (isInputRange!R && isIntegral!(ElementType!R))
// Test opIndex and opSlice
@system unittest
{
import std.meta : AliasSeq;
alias IntegralTypes = AliasSeq!(byte, ubyte, short, ushort, int, uint,
long, ulong);
foreach (IntegralType; IntegralTypes)
Expand Down
3 changes: 2 additions & 1 deletion std/regex/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ module std.regex;

import std.range.primitives, std.traits;
import std.regex.internal.ir;
import std.typecons; // : Flag, Yes, No;
import std.typecons : Flag, Yes, No;

/++
$(D Regex) object holds regular expression pattern in compiled form.
Expand Down Expand Up @@ -704,6 +704,7 @@ public:
@trusted public struct RegexMatch(R)
if (isSomeString!R)
{
import std.typecons : Rebindable;
private:
alias Char = BasicElementOf!R;
Matcher!Char _engine;
Expand Down
14 changes: 7 additions & 7 deletions std/stdio.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Authors: $(HTTP digitalmars.com, Walter Bright),
*/
module std.stdio;

import core.stdc.stddef; // wchar_t
import core.stdc.stddef : wchar_t;
public import core.stdc.stdio;
import std.algorithm.mutation; // copy
import std.meta; // allSatisfy
import std.range.primitives; // ElementEncodingType, empty, front,
// isBidirectionalRange, isInputRange, put
import std.traits; // isSomeChar, isSomeString, Unqual, isPointer
import std.typecons; // Flag
import std.algorithm.mutation : copy;
import std.meta : allSatisfy;
import std.range.primitives : ElementEncodingType, empty, front,
isBidirectionalRange, isInputRange, put;
import std.traits : isSomeChar, isSomeString, Unqual, isPointer;
import std.typecons : Flag, Yes, No;

/++
If flag $(D KeepTerminator) is set to $(D KeepTerminator.yes), then the delimiter
Expand Down
14 changes: 7 additions & 7 deletions std/string.d
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ public import std.format : format, sformat;
import std.typecons : Flag, Yes, No;
public import std.uni : icmp, toLower, toLowerInPlace, toUpper, toUpperInPlace;

import std.meta; // AliasSeq, staticIndexOf
import std.range.primitives; // back, ElementEncodingType, ElementType, front,
// hasLength, hasSlicing, isBidirectionalRange, isForwardRange, isInfinite,
// isInputRange, isOutputRange, isRandomAccessRange, popBack, popFront, put,
// save;
import std.traits; // isConvertibleToString, isNarrowString, isSomeChar,
// isSomeString, StringTypeOf, Unqual
import std.meta : AliasSeq, staticIndexOf;
import std.range.primitives : back, ElementEncodingType, ElementType, front,
hasLength, hasSlicing, isBidirectionalRange, isForwardRange, isInfinite,
isInputRange, isOutputRange, isRandomAccessRange, popBack, popFront, put,
save;
import std.traits : isConvertibleToString, isNarrowString, isSomeChar,
isSomeString, StringTypeOf, Unqual;

//public imports for backward compatibility
public import std.algorithm.comparison : cmp;
Expand Down
3 changes: 2 additions & 1 deletion std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Authors: $(HTTP erdani.org, Andrei Alexandrescu),
module std.typecons;

import core.stdc.stdint : uintptr_t;
import std.meta; // : AliasSeq, allSatisfy;
import std.meta : Alias, AliasSeq, aliasSeqOf, allSatisfy;
import std.traits;

///
Expand Down Expand Up @@ -4260,6 +4260,7 @@ private static:
};
}
}
import std.meta : templateNot;

alias Implementation = AutoImplement!(Issue17177, how, templateNot!isFinalFunction);
}
Expand Down
Loading