Remove obsolete TypeTuple references

Replace following names:
std.typetuple      -> std.meta
TypeTuple          -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple     -> Fields

std.traits requires more work than search/replace and is left unchanged.
This commit is contained in:
Dragos Carp 2015-10-13 20:30:32 +02:00
parent 8d9d606ef8
commit d698887729
48 changed files with 643 additions and 645 deletions

View file

@ -68,9 +68,9 @@ to $(WEB fantascienza.net/leonardo/so/, Leonardo Maffi).
*/
module std.range.interfaces;
import std.meta;
import std.range.primitives;
import std.traits;
import std.typetuple;
/**These interfaces are intended to provide virtual function-based wrappers
* around input ranges with element type E. This is useful where a well-defined

View file

@ -176,8 +176,8 @@ public import std.range.interfaces;
public import std.array;
public import std.typecons : Flag, Yes, No;
import std.meta;
import std.traits;
import std.typetuple;
/**
@ -855,7 +855,7 @@ if (Ranges.length > 0 &&
}
}
import std.typetuple : anySatisfy;
import std.meta : anySatisfy;
static if (anySatisfy!(isInfinite, R))
{
@ -2507,22 +2507,22 @@ auto takeNone(R)(R range)
import std.format : format;
foreach(range; TypeTuple!([1, 2, 3, 4, 5],
"hello world",
"hello world"w,
"hello world"d,
SliceStruct([1, 2, 3]),
//@@@BUG@@@ 8339 forces this to be takeExactly
//`InitStruct([1, 2, 3]),
TakeNoneStruct([1, 2, 3])))
foreach(range; AliasSeq!([1, 2, 3, 4, 5],
"hello world",
"hello world"w,
"hello world"d,
SliceStruct([1, 2, 3]),
//@@@BUG@@@ 8339 forces this to be takeExactly
//`InitStruct([1, 2, 3]),
TakeNoneStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
assert(takeNone(range).empty);
static assert(is(typeof(range) == typeof(takeNone(range))), typeof(range).stringof);
}
foreach(range; TypeTuple!(NormalStruct([1, 2, 3]),
InitStruct([1, 2, 3])))
foreach(range; AliasSeq!(NormalStruct([1, 2, 3]),
InitStruct([1, 2, 3])))
{
static assert(takeNone(range).empty, typeof(range).stringof);
assert(takeNone(range).empty);
@ -4971,7 +4971,7 @@ unittest
assert(iota(uint.max, 0u, -1).length == uint.max);
// Issue 8920
foreach (Type; TypeTuple!(byte, ubyte, short, ushort,
foreach (Type; AliasSeq!(byte, ubyte, short, ushort,
int, uint, long, ulong))
{
Type val;
@ -4989,10 +4989,10 @@ unittest
@safe unittest
{
foreach(range; TypeTuple!(iota(2, 27, 4),
iota(3, 9),
iota(2.7, 12.3, .1),
iota(3.2, 9.7)))
foreach(range; AliasSeq!(iota(2, 27, 4),
iota(3, 9),
iota(2.7, 12.3, .1),
iota(3.2, 9.7)))
{
const cRange = range;
const e = cRange.empty;
@ -6719,12 +6719,12 @@ unittest
assert(saved[0 .. 0].empty);
assert(saved[3 .. 3].empty);
alias data = TypeTuple!("one", "two", "three", "four");
alias data = AliasSeq!("one", "two", "three", "four");
static joined =
["one two", "one two three", "one two three four"];
string[] joinedRange = joined;
foreach(argCount; TypeTuple!(2, 3, 4))
foreach(argCount; AliasSeq!(2, 3, 4))
{
auto values = only(data[0 .. argCount]);
alias Values = typeof(values);
@ -6976,7 +6976,7 @@ pure @safe nothrow unittest
}
}
foreach (DummyType; TypeTuple!(AllDummyRanges, HasSlicing))
foreach (DummyType; AliasSeq!(AllDummyRanges, HasSlicing))
{
alias R = typeof(enumerate(DummyType.init));
static assert(isInputRange!R);
@ -7042,7 +7042,7 @@ pure @safe nothrow unittest
assert(shifted.empty);
}
foreach(T; TypeTuple!(ubyte, byte, uint, int))
foreach(T; AliasSeq!(ubyte, byte, uint, int))
{
auto inf = 42.repeat().enumerate(T.max);
alias Inf = typeof(inf);
@ -7069,7 +7069,7 @@ pure @safe unittest
{
import std.algorithm : equal;
static immutable int[] values = [0, 1, 2, 3, 4];
foreach(T; TypeTuple!(ubyte, ushort, uint, ulong))
foreach(T; AliasSeq!(ubyte, ushort, uint, ulong))
{
auto enumerated = values.enumerate!T();
static assert(is(typeof(enumerated.front.index) == T));
@ -7110,7 +7110,7 @@ version(none) // @@@BUG@@@ 10939
}
SignedLengthRange svalues;
foreach(Enumerator; TypeTuple!(ubyte, byte, ushort, short, uint, int, ulong, long))
foreach(Enumerator; AliasSeq!(ubyte, byte, ushort, short, uint, int, ulong, long))
{
assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max));
assertNotThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length));
@ -7121,7 +7121,7 @@ version(none) // @@@BUG@@@ 10939
assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length + 1));
}
foreach(Enumerator; TypeTuple!(byte, short, int))
foreach(Enumerator; AliasSeq!(byte, short, int))
{
assertThrown!RangeError(repeat(0, uint.max).enumerate!Enumerator());
}
@ -8991,14 +8991,14 @@ if (is(typeof(fun) == void) || isSomeFunction!fun)
auto result3 = txt.tee(asink3).array;
assert(equal(txt, result3) && equal(result3, asink3));
foreach (CharType; TypeTuple!(char, wchar, dchar))
foreach (CharType; AliasSeq!(char, wchar, dchar))
{
auto appSink = appender!(CharType[])();
auto appResult = txt.tee(appSink).array;
assert(equal(txt, appResult) && equal(appResult, appSink.data));
}
foreach (StringType; TypeTuple!(string, wstring, dstring))
foreach (StringType; AliasSeq!(string, wstring, dstring))
{
auto appSink = appender!StringType();
auto appResult = txt.tee(appSink).array;

View file

@ -511,8 +511,8 @@ unittest
unittest
{
import std.conv : to;
import std.meta : AliasSeq;
import std.typecons : tuple;
import std.typetuple;
static struct PutC(C)
{
@ -538,7 +538,7 @@ unittest
putChar(p, cast(dchar)'a');
//Source Char
foreach (SC; TypeTuple!(char, wchar, dchar))
foreach (SC; AliasSeq!(char, wchar, dchar))
{
SC ch = 'I';
dchar dh = '♥';
@ -546,10 +546,10 @@ unittest
immutable(SC)[][] ss = ["日本語", "が", "好き", "ですか", ""];
//Target Char
foreach (TC; TypeTuple!(char, wchar, dchar))
foreach (TC; AliasSeq!(char, wchar, dchar))
{
//Testing PutC and PutS
foreach (Type; TypeTuple!(PutC!TC, PutS!TC))
foreach (Type; AliasSeq!(PutC!TC, PutS!TC))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
Type type;
auto sink = new Type();
@ -609,7 +609,7 @@ unittest
unittest
{
import std.format;
import std.typetuple;
import std.meta : AliasSeq;
struct PutC(C)
{
void put(C){}
@ -642,7 +642,7 @@ unittest
}
void foo()
{
foreach(C; TypeTuple!(char, wchar, dchar))
foreach(C; AliasSeq!(char, wchar, dchar))
{
formattedWrite((C c){}, "", 1, 'a', cast(wchar)'a', cast(dchar)'a', "a"c, "a"w, "a"d);
formattedWrite((const(C)[]){}, "", 1, 'a', cast(wchar)'a', cast(dchar)'a', "a"c, "a"w, "a"d);
@ -2090,9 +2090,9 @@ if (isNarrowString!(C[]))
@safe pure unittest
{
import std.typetuple;
import std.meta : AliasSeq;
foreach(S; TypeTuple!(string, wstring, dstring))
foreach(S; AliasSeq!(string, wstring, dstring))
{
S s = "\xC2\xA9hello";
s.popFront();
@ -2163,9 +2163,9 @@ if (isNarrowString!(T[]))
@safe pure unittest
{
import std.typetuple;
import std.meta : AliasSeq;
foreach(S; TypeTuple!(string, wstring, dstring))
foreach(S; AliasSeq!(string, wstring, dstring))
{
S s = "hello\xE2\x89\xA0";
s.popBack();