diff --git a/std/algorithm/comparison.d b/std/algorithm/comparison.d index 19f905275..5eb983f08 100644 --- a/std/algorithm/comparison.d +++ b/std/algorithm/comparison.d @@ -132,7 +132,7 @@ efficient search, but one that only supports matching on equality: @safe unittest { - import std.meta : TypeTuple; + import std.meta : MetaList; if (auto pos = 3.among(1, 2, 3)) assert(pos == 3); @@ -144,7 +144,7 @@ efficient search, but one that only supports matching on equality: assert(position); assert(position == 1); - alias values = TypeTuple!("foo", "bar", "baz"); + alias values = MetaList!("foo", "bar", "baz"); auto arr = [values]; assert(arr[0 .. "foo".among(values)] == ["foo"]); assert(arr[0 .. "bar".among(values)] == ["foo", "bar"]); diff --git a/std/algorithm/iteration.d b/std/algorithm/iteration.d index 9ff182c5c..7f4aed25e 100644 --- a/std/algorithm/iteration.d +++ b/std/algorithm/iteration.d @@ -294,15 +294,15 @@ private struct _Cache(R, bool bidir) private { import std.algorithm.internal : algoFormat; - import std.meta : TypeTuple; + import std.meta : MetaList; alias E = ElementType!R; alias UE = Unqual!E; R source; - static if (bidir) alias CacheTypes = TypeTuple!(UE, UE); - else alias CacheTypes = TypeTuple!UE; + static if (bidir) alias CacheTypes = MetaList!(UE, UE); + else alias CacheTypes = MetaList!UE; CacheTypes caches; static assert(isAssignable!(UE, E) && is(UE : E), @@ -817,8 +817,8 @@ See_Also: $(XREF range,tee) */ template each(alias pred = "a") { - import std.meta : TypeTuple; - alias BinaryArgs = TypeTuple!(pred, "i", "a"); + import std.meta : MetaList; + alias BinaryArgs = MetaList!(pred, "i", "a"); enum isRangeUnaryIterable(R) = is(typeof(unaryFun!pred(R.init.front))); @@ -3756,8 +3756,8 @@ if (isSomeChar!C) @safe pure unittest { import std.algorithm.comparison : equal; - import std.meta : TypeTuple; - foreach(S; TypeTuple!(string, wstring, dstring)) + import std.meta : MetaList; + foreach(S; MetaList!(string, wstring, dstring)) { import std.conv : to; S a = " a bcd ef gh "; diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d index a02d10585..22f752d7e 100644 --- a/std/algorithm/mutation.d +++ b/std/algorithm/mutation.d @@ -736,7 +736,7 @@ unittest { import std.algorithm.iteration : filter; import std.traits : hasElaborateAssign; - import std.meta : TypeTuple; + import std.meta : MetaList; debug(std_algorithm) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " done."); @@ -787,7 +787,7 @@ unittest assert (!typeid(S3).init().ptr); assert ( typeid(S4).init().ptr); - foreach(S; TypeTuple!(S1, S2, S3, S4)) + foreach(S; MetaList!(S1, S2, S3, S4)) { //initializeAll { diff --git a/std/algorithm/searching.d b/std/algorithm/searching.d index e0ccf0bbf..18454c317 100644 --- a/std/algorithm/searching.d +++ b/std/algorithm/searching.d @@ -481,7 +481,7 @@ if (isNarrowString!R1 && isNarrowString!R2) import std.exception : assertThrown; import std.utf : UTFException; import std.range; - import std.meta : TypeTuple; + import std.meta : MetaList; assert(commonPrefix([1, 2, 3], [1, 2, 3, 4, 5]) == [1, 2, 3]); assert(commonPrefix([1, 2, 3, 4, 5], [1, 2, 3]) == [1, 2, 3]); @@ -492,11 +492,11 @@ if (isNarrowString!R1 && isNarrowString!R2) assert(commonPrefix(cast(int[])null, [1, 2, 3]).empty); assert(commonPrefix(cast(int[])null, cast(int[])null).empty); - foreach (S; TypeTuple!(char[], const(char)[], string, + foreach (S; MetaList!(char[], const(char)[], string, wchar[], const(wchar)[], wstring, dchar[], const(dchar)[], dstring)) { - foreach(T; TypeTuple!(string, wstring, dstring)) + foreach(T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(commonPrefix(to!S(""), to!T("")).empty); assert(commonPrefix(to!S(""), to!T("hello")).empty); @@ -1065,13 +1065,13 @@ if (isBidirectionalRange!R && @safe unittest { import std.algorithm.iteration : filterBidirectional; - import std.meta : TypeTuple; + import std.meta : MetaList; import std.conv : to; debug(std_algorithm) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " done."); - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { assert(!endsWith(to!S("abc"), 'a')); assert(endsWith(to!S("abc"), 'a', 'c') == 2); @@ -1079,7 +1079,7 @@ if (isBidirectionalRange!R && assert(endsWith(to!S("abc"), 'x', 'n', 'c') == 3); assert(endsWith(to!S("abc\uFF28"), 'a', '\uFF28', 'c') == 2); - foreach (T; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (T; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 //Lots of strings assert(endsWith(to!S("abc"), to!T(""))); @@ -1113,7 +1113,7 @@ if (isBidirectionalRange!R && }(); } - foreach (T; TypeTuple!(int, short)) + foreach (T; MetaList!(int, short)) { immutable arr = cast(T[])[0, 1, 2, 3, 4, 5]; @@ -1367,10 +1367,10 @@ if (isInputRange!InputRange && @safe pure unittest { - import std.meta : TypeTuple; - foreach(R; TypeTuple!(string, wstring, dstring)) + import std.meta : MetaList; + foreach(R; MetaList!(string, wstring, dstring)) { - foreach(E; TypeTuple!(char, wchar, dchar)) + foreach(E; MetaList!(char, wchar, dchar)) { R r1 = "hello world"; E e1 = 'w'; @@ -1411,15 +1411,15 @@ if (isInputRange!InputRange && @safe unittest { import std.exception : assertCTFEable; - import std.meta : TypeTuple; + import std.meta : MetaList; void dg() @safe pure nothrow { byte[] sarr = [1, 2, 3, 4]; ubyte[] uarr = [1, 2, 3, 4]; - foreach(arr; TypeTuple!(sarr, uarr)) + foreach(arr; MetaList!(sarr, uarr)) { - foreach(T; TypeTuple!(byte, ubyte, int, uint)) + foreach(T; MetaList!(byte, ubyte, int, uint)) { assert(find(arr, cast(T) 3) == arr[2 .. $]); assert(find(arr, cast(T) 9) == arr[$ .. $]); @@ -1959,7 +1959,7 @@ if (Ranges.length > 1 && is(typeof(startsWith!pred(haystack, needles)))) @safe unittest { import std.algorithm.internal : rndstuff; - import std.meta : TypeTuple; + import std.meta : MetaList; import std.uni : toUpper; debug(std_algorithm) scope(success) @@ -1969,7 +1969,7 @@ if (Ranges.length > 1 && is(typeof(startsWith!pred(haystack, needles)))) assert(find(a, 5).empty); assert(find(a, 2) == [2, 3]); - foreach (T; TypeTuple!(int, double)) + foreach (T; MetaList!(int, double)) { auto b = rndstuff!(T)(); if (!b.length) continue; @@ -1992,7 +1992,7 @@ if (Ranges.length > 1 && is(typeof(startsWith!pred(haystack, needles)))) import std.algorithm.internal : rndstuff; import std.algorithm.comparison : equal; import std.range : retro; - import std.meta : TypeTuple; + import std.meta : MetaList; debug(std_algorithm) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " done."); @@ -2001,7 +2001,7 @@ if (Ranges.length > 1 && is(typeof(startsWith!pred(haystack, needles)))) assert(find(retro(a), 5).empty); assert(equal(find(retro(a), 2), [ 2, 3, 2, 1 ][])); - foreach (T; TypeTuple!(int, double)) + foreach (T; MetaList!(int, double)) { auto b = rndstuff!(T)(); if (!b.length) continue; @@ -2688,7 +2688,7 @@ unittest unittest { import std.conv : text; - import std.meta : TypeTuple; + import std.meta : MetaList; debug(std_algorithm) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " done."); @@ -2738,7 +2738,7 @@ unittest } static assert(!isAssignable!S3); - foreach (Type; TypeTuple!(S1, IS1, S2, IS2, S3)) + foreach (Type; MetaList!(S1, IS1, S2, IS2, S3)) { static if (is(Type == immutable)) alias V = immutable int; else alias V = int; @@ -3171,12 +3171,12 @@ if (isInputRange!R && import std.algorithm.iteration : filter; import std.conv : to; import std.range; - import std.meta : TypeTuple; + import std.meta : MetaList; debug(std_algorithm) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " done."); - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { assert(!startsWith(to!S("abc"), 'c')); assert(startsWith(to!S("abc"), 'a', 'c') == 1); @@ -3184,7 +3184,7 @@ if (isInputRange!R && assert(startsWith(to!S("abc"), 'x', 'n', 'a') == 3); assert(startsWith(to!S("\uFF28abc"), 'a', '\uFF28', 'c') == 2); - foreach (T; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (T; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 //Lots of strings assert(startsWith(to!S("abc"), to!T(""))); @@ -3226,7 +3226,7 @@ if (isInputRange!R && assert(startsWith("abc".takeExactly(3), "abcd".takeExactly(3))); assert(startsWith("abc".takeExactly(3), "abcd".takeExactly(1))); - foreach (T; TypeTuple!(int, short)) + foreach (T; MetaList!(int, short)) { immutable arr = cast(T[])[0, 1, 2, 3, 4, 5]; diff --git a/std/algorithm/setops.d b/std/algorithm/setops.d index d749053e3..7949941f1 100644 --- a/std/algorithm/setops.d +++ b/std/algorithm/setops.d @@ -47,7 +47,7 @@ import std.range.primitives; import std.functional; // : unaryFun, binaryFun; import std.traits; // FIXME -import std.meta; // : TypeTuple, staticMap, allSatisfy, anySatisfy; +import std.meta; // : MetaList, staticMap, allSatisfy, anySatisfy; // cartesianProduct /** diff --git a/std/array.d b/std/array.d index ce2abb24f..09f9b8da5 100644 --- a/std/array.d +++ b/std/array.d @@ -275,7 +275,7 @@ unittest int i; } - foreach(T; TypeTuple!(S, const S, immutable S)) + foreach(T; MetaList!(S, const S, immutable S)) { auto arr = [T(1), T(2), T(3), T(4)]; assert(array(arr) == arr); @@ -1163,10 +1163,10 @@ unittest new AssertError("testStr failure 3", file, line)); } - foreach (T; TypeTuple!(char, wchar, dchar, + foreach (T; MetaList!(char, wchar, dchar, immutable(char), immutable(wchar), immutable(dchar))) { - foreach (U; TypeTuple!(char, wchar, dchar, + foreach (U; MetaList!(char, wchar, dchar, immutable(char), immutable(wchar), immutable(dchar))) { testStr!(T[], U[])(); @@ -1304,7 +1304,7 @@ pure nothrow bool sameTail(T)(in T[] lhs, in T[] rhs) @safe pure nothrow unittest { - foreach(T; TypeTuple!(int[], const(int)[], immutable(int)[], const int[], immutable int[])) + foreach(T; MetaList!(int[], const(int)[], immutable(int)[], const int[], immutable int[])) { T a = [1, 2, 3, 4, 5]; T b = a; @@ -1372,7 +1372,7 @@ unittest debug(std_array) printf("array.replicate.unittest\n"); - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) + foreach (S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[])) { S s; immutable S t = "abc"; @@ -1440,7 +1440,7 @@ unittest static auto makeEntry(S)(string l, string[] r) {return tuple(l.to!S(), r.to!(S[])());} - foreach (S; TypeTuple!(string, wstring, dstring,)) + foreach (S; MetaList!(string, wstring, dstring,)) { auto entries = [ @@ -1532,7 +1532,7 @@ unittest import std.algorithm : cmp; debug(std_array) printf("array.split\n"); - foreach (S; TypeTuple!(string, wstring, dstring, + foreach (S; MetaList!(string, wstring, dstring, immutable(string), immutable(wstring), immutable(dstring), char[], wchar[], dchar[], const(char)[], const(wchar)[], const(dchar)[], @@ -1806,18 +1806,18 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR)(RoR ror) { import std.conv : to; - foreach (T; TypeTuple!(string,wstring,dstring)) + foreach (T; MetaList!(string,wstring,dstring)) { auto arr2 = "Здравствуй Мир Unicode".to!(T); auto arr = ["Здравствуй", "Мир", "Unicode"].to!(T[]); assert(join(arr) == "ЗдравствуйМирUnicode"); - foreach (S; TypeTuple!(char,wchar,dchar)) + foreach (S; MetaList!(char,wchar,dchar)) { auto jarr = arr.join(to!S(' ')); static assert(is(typeof(jarr) == T)); assert(jarr == arr2); } - foreach (S; TypeTuple!(string,wstring,dstring)) + foreach (S; MetaList!(string,wstring,dstring)) { auto jarr = arr.join(to!S(" ")); static assert(is(typeof(jarr) == T)); @@ -1825,11 +1825,11 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR)(RoR ror) } } - foreach (T; TypeTuple!(string,wstring,dstring)) + foreach (T; MetaList!(string,wstring,dstring)) { auto arr2 = "Здравствуй\u047CМир\u047CUnicode".to!(T); auto arr = ["Здравствуй", "Мир", "Unicode"].to!(T[]); - foreach (S; TypeTuple!(wchar,dchar)) + foreach (S; MetaList!(wchar,dchar)) { auto jarr = arr.join(to!S('\u047C')); static assert(is(typeof(jarr) == T)); @@ -1849,7 +1849,7 @@ unittest debug(std_array) printf("array.join.unittest\n"); - foreach(R; TypeTuple!(string, wstring, dstring)) + foreach(R; MetaList!(string, wstring, dstring)) { R word1 = "日本語"; R word2 = "paul"; @@ -1866,7 +1866,7 @@ unittest auto filteredLenWordsArr = [filteredLenWord1, filteredLenWord2, filteredLenWord3]; auto filteredWords = filter!"true"(filteredWordsArr); - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(join(filteredWords, to!S(", ")) == "日本語, paul, jerry"); assert(join(filteredWords, to!(ElementType!S)(',')) == "日本語,paul,jerry"); @@ -2044,9 +2044,9 @@ unittest debug(std_array) printf("array.replace.unittest\n"); - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) + foreach (S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[])) { - foreach (T; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) + foreach (T; MetaList!(string, wstring, dstring, char[], wchar[], dchar[])) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 auto s = to!S("This is a foo foo list"); auto from = to!T("foo"); @@ -2081,7 +2081,7 @@ unittest this(C[] arr){ desired = arr; } void put(C[] part){ assert(skipOver(desired, part)); } } - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) + foreach (S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[])) { alias Char = ElementEncodingType!S; S s = to!S("yet another dummy text, yet another ..."); @@ -2410,10 +2410,10 @@ unittest debug(std_array) printf("array.replaceFirst.unittest\n"); - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[], + foreach (S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[], const(char[]), immutable(char[]))) { - foreach (T; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[], + foreach (T; MetaList!(string, wstring, dstring, char[], wchar[], dchar[], const(char[]), immutable(char[]))) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 auto s = to!S("This is a foo foo list"); @@ -2518,10 +2518,10 @@ unittest debug(std_array) printf("array.replaceLast.unittest\n"); - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[], + foreach (S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[], const(char[]), immutable(char[]))) { - foreach (T; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[], + foreach (T; MetaList!(string, wstring, dstring, char[], wchar[], dchar[], const(char[]), immutable(char[]))) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 auto s = to!S("This is a foo foo list"); @@ -3137,7 +3137,7 @@ Appender!(E[]) appender(A : E[], E)(auto ref A array) catch (Exception) assert(0); // Issue 5663 & 9725 tests - foreach (S; TypeTuple!(char[], const(char)[], string)) + foreach (S; MetaList!(char[], const(char)[], string)) { { Appender!S app5663i; diff --git a/std/ascii.d b/std/ascii.d index 8047b9946..1bc8ff2f5 100644 --- a/std/ascii.d +++ b/std/ascii.d @@ -30,7 +30,7 @@ version (unittest) // FIXME: When dmd bug #314 is fixed, make these selective. import std.range; // : chain; import std.traits; // : functionAttributes, FunctionAttribute, isSafe; - import std.meta; // : TypeTuple; + import std.meta; // : MetaList; } @@ -531,7 +531,7 @@ auto toLower(C)(C c) @safe pure nothrow unittest { - foreach(C; TypeTuple!(char, wchar, dchar, immutable char, ubyte)) + foreach(C; MetaList!(char, wchar, dchar, immutable char, ubyte)) { foreach(i, c; uppercase) assert(toLower(cast(C)c) == lowercase[i]); @@ -592,7 +592,7 @@ auto toUpper(C)(C c) @safe pure nothrow unittest { - foreach(C; TypeTuple!(char, wchar, dchar, immutable char, ubyte)) + foreach(C; MetaList!(char, wchar, dchar, immutable char, ubyte)) { foreach(i, c; lowercase) assert(toUpper(cast(C)c) == uppercase[i]); @@ -631,7 +631,7 @@ unittest //Test both toUpper and toLower with non-builtin enum UDDE : UDD {a = UDD('a'), A = UDD('A')} //User defined types with implicit cast to dchar test. - foreach (Char; TypeTuple!(UDC, UDW, UDD)) + foreach (Char; MetaList!(UDC, UDW, UDD)) { assert(toLower(Char('a')) == 'a'); assert(toLower(Char('A')) == 'a'); @@ -642,7 +642,7 @@ unittest //Test both toUpper and toLower with non-builtin } //Various enum tests. - foreach (Enum; TypeTuple!(CE, WE, DE, UDCE, UDWE, UDDE)) + foreach (Enum; MetaList!(CE, WE, DE, UDCE, UDWE, UDDE)) { assert(toLower(Enum.a) == 'a'); assert(toLower(Enum.A) == 'a'); @@ -655,7 +655,7 @@ unittest //Test both toUpper and toLower with non-builtin } //Return value type tests for enum of non-UDT. These should be the original type. - foreach (T; TypeTuple!(CE, WE, DE)) + foreach (T; MetaList!(CE, WE, DE)) { alias C = OriginalType!T; static assert(is(typeof(toLower(T.init)) == C)); @@ -663,7 +663,7 @@ unittest //Test both toUpper and toLower with non-builtin } //Return value tests for UDT and enum of UDT. These should be dchar - foreach (T; TypeTuple!(UDC, UDW, UDD, UDCE, UDWE, UDDE)) + foreach (T; MetaList!(UDC, UDW, UDD, UDCE, UDWE, UDDE)) { static assert(is(typeof(toLower(T.init)) == dchar)); static assert(is(typeof(toUpper(T.init)) == dchar)); diff --git a/std/bigint.d b/std/bigint.d index 1e709aad3..1413ce301 100644 --- a/std/bigint.d +++ b/std/bigint.d @@ -1263,12 +1263,12 @@ unittest // 11148 assert(__traits(compiles, foo(cbi))); assert(__traits(compiles, foo(ibi))); - import std.meta : TypeTuple; + import std.meta : MetaList; import std.conv : to; - foreach (T1; TypeTuple!(BigInt, const(BigInt), immutable(BigInt))) + foreach (T1; MetaList!(BigInt, const(BigInt), immutable(BigInt))) { - foreach (T2; TypeTuple!(BigInt, const(BigInt), immutable(BigInt))) + foreach (T2; MetaList!(BigInt, const(BigInt), immutable(BigInt))) { T1 t1 = 2; T2 t2 = t1; @@ -1343,8 +1343,8 @@ unittest // 13391 BigInt x2 = "123456789123456789"; BigInt x3 = "123456789123456789123456789"; - import std.meta : TypeTuple; - foreach (T; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + import std.meta : MetaList; + foreach (T; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { assert((x1 * T.max) / T.max == x1); assert((x2 * T.max) / T.max == x2); @@ -1371,8 +1371,8 @@ unittest // 13391 unittest // 13963 { BigInt x = 1; - import std.meta : TypeTuple; - foreach(Int; TypeTuple!(byte, ubyte, short, ushort, int, uint)) + import std.meta : MetaList; + foreach(Int; MetaList!(byte, ubyte, short, ushort, int, uint)) { assert(is(typeof(x % Int(1)) == int)); } diff --git a/std/bitmanip.d b/std/bitmanip.d index 412787483..5b593ae9b 100644 --- a/std/bitmanip.d +++ b/std/bitmanip.d @@ -2161,7 +2161,7 @@ private ulong swapEndianImpl(ulong val) @trusted pure nothrow @nogc unittest { import std.meta; - foreach(T; TypeTuple!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar)) + foreach(T; MetaList!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar)) { scope(failure) writefln("Failed type: %s", T.stringof); T val; @@ -2277,7 +2277,7 @@ private auto nativeToBigEndianImpl(T)(T val) @safe pure nothrow @nogc unittest { import std.meta; - foreach(T; TypeTuple!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, + foreach(T; MetaList!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar /* The trouble here is with floats and doubles being compared against nan * using a bit compare. There are two kinds of nans, quiet and signaling. @@ -2451,7 +2451,7 @@ private auto nativeToLittleEndianImpl(T)(T val) @safe pure nothrow @nogc unittest { import std.meta; - foreach(T; TypeTuple!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, + foreach(T; MetaList!(bool, byte, ubyte, short, ushort, int, uint, long, ulong, char, wchar, dchar/*, float, double*/)) { @@ -2581,7 +2581,7 @@ private template isFloatOrDouble(T) unittest { import std.meta; - foreach(T; TypeTuple!(float, double)) + foreach(T; MetaList!(float, double)) { static assert(isFloatOrDouble!(T)); static assert(isFloatOrDouble!(const T)); @@ -2610,7 +2610,7 @@ private template canSwapEndianness(T) unittest { import std.meta; - foreach(T; TypeTuple!(bool, ubyte, byte, ushort, short, uint, int, ulong, + foreach(T; MetaList!(bool, ubyte, byte, ushort, short, uint, int, ulong, long, char, wchar, dchar, float, double)) { static assert(canSwapEndianness!(T)); @@ -2622,7 +2622,7 @@ unittest } //! - foreach(T; TypeTuple!(real, string, wstring, dstring)) + foreach(T; MetaList!(real, string, wstring, dstring)) { static assert(!canSwapEndianness!(T)); static assert(!canSwapEndianness!(const T)); @@ -3701,10 +3701,10 @@ unittest import std.format : format; import std.array; import std.meta; - foreach(endianness; TypeTuple!(Endian.bigEndian, Endian.littleEndian)) + foreach(endianness; MetaList!(Endian.bigEndian, Endian.littleEndian)) { auto toWrite = appender!(ubyte[])(); - alias Types = TypeTuple!(uint, int, long, ulong, short, ubyte, ushort, byte, uint); + alias Types = MetaList!(uint, int, long, ulong, short, ubyte, ushort, byte, uint); ulong[] values = [42, -11, long.max, 1098911981329L, 16, 255, 19012, 2, 17]; assert(Types.length == values.length); @@ -3776,7 +3776,7 @@ unittest unittest { import std.meta; - foreach (T; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (T; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { assert(countTrailingZeros(cast(T)0) == 8 * T.sizeof); assert(countTrailingZeros(cast(T)1) == 0); @@ -3857,7 +3857,7 @@ unittest unittest { import std.meta; - foreach (T; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (T; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { assert(countBitsSet(cast(T)0) == 0); assert(countBitsSet(cast(T)1) == 1); @@ -3958,7 +3958,7 @@ unittest import std.range: iota; import std.meta; - foreach (T; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (T; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { assert(bitsSet(cast(T)0).empty); assert(bitsSet(cast(T)1).equal([0])); diff --git a/std/concurrency.d b/std/concurrency.d index 5495cb51d..b19656263 100644 --- a/std/concurrency.d +++ b/std/concurrency.d @@ -1903,7 +1903,7 @@ private static if( isImplicitlyConvertible!(T[0], Duration) ) { - alias Ops = TypeTuple!(T[1 .. $]); + alias Ops = MetaList!(T[1 .. $]); alias ops = vals[1 .. $]; assert( vals[0] >= msecs(0) ); enum timedWait = true; @@ -1911,7 +1911,7 @@ private } else { - alias Ops = TypeTuple!(T); + alias Ops = MetaList!(T); alias ops = vals[0 .. $]; enum timedWait = false; } diff --git a/std/container/package.d b/std/container/package.d index 56dfebc4d..b1d507257 100644 --- a/std/container/package.d +++ b/std/container/package.d @@ -469,7 +469,7 @@ the type of the $(D k)th key of the container. A container may define both $(D KeyType) and $(D KeyTypes), e.g. in the case it has the notion of primary/preferred key. */ - alias KeyTypes = TypeTuple!T; + alias KeyTypes = MetaList!T; /** If the container has a notion of key-value mapping, $(D ValueType) diff --git a/std/conv.d b/std/conv.d index a8b2b30da..8a1a7e9e0 100644 --- a/std/conv.d +++ b/std/conv.d @@ -332,12 +332,12 @@ template to(T) @safe pure unittest { import std.exception; - foreach (T; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (T; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { assertThrown!ConvException(to!T(" 0")); assertThrown!ConvException(to!T(" 0", 8)); } - foreach (T; TypeTuple!(float, double, real)) + foreach (T; MetaList!(float, double, real)) { assertThrown!ConvException(to!T(" 0")); } @@ -404,12 +404,12 @@ T toImpl(T, S)(S value) { import std.exception; // Conversion between same size - foreach (S; TypeTuple!(byte, short, int, long)) + foreach (S; MetaList!(byte, short, int, long)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 alias U = Unsigned!S; - foreach (Sint; TypeTuple!(S, const S, immutable S)) - foreach (Uint; TypeTuple!(U, const U, immutable U)) + foreach (Sint; MetaList!(S, const S, immutable S)) + foreach (Uint; MetaList!(U, const U, immutable U)) { // positive overflow Uint un = Uint.max; @@ -424,8 +424,8 @@ T toImpl(T, S)(S value) }(); // Conversion between different size - foreach (i, S1; TypeTuple!(byte, short, int, long)) - foreach ( S2; TypeTuple!(byte, short, int, long)[i+1..$]) + foreach (i, S1; MetaList!(byte, short, int, long)) + foreach ( S2; MetaList!(byte, short, int, long)[i+1..$]) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 alias U1 = Unsigned!S1; alias U2 = Unsigned!S2; @@ -433,8 +433,8 @@ T toImpl(T, S)(S value) static assert(U1.sizeof < S2.sizeof); // small unsigned to big signed - foreach (Uint; TypeTuple!(U1, const U1, immutable U1)) - foreach (Sint; TypeTuple!(S2, const S2, immutable S2)) + foreach (Uint; MetaList!(U1, const U1, immutable U1)) + foreach (Sint; MetaList!(S2, const S2, immutable S2)) { Uint un = Uint.max; assertNotThrown(to!Sint(un)); @@ -442,8 +442,8 @@ T toImpl(T, S)(S value) } // big unsigned to small signed - foreach (Uint; TypeTuple!(U2, const U2, immutable U2)) - foreach (Sint; TypeTuple!(S1, const S1, immutable S1)) + foreach (Uint; MetaList!(U2, const U2, immutable U2)) + foreach (Sint; MetaList!(S1, const S1, immutable S1)) { Uint un = Uint.max; assertThrown(to!Sint(un)); @@ -452,16 +452,16 @@ T toImpl(T, S)(S value) static assert(S1.sizeof < U2.sizeof); // small signed to big unsigned - foreach (Sint; TypeTuple!(S1, const S1, immutable S1)) - foreach (Uint; TypeTuple!(U2, const U2, immutable U2)) + foreach (Sint; MetaList!(S1, const S1, immutable S1)) + foreach (Uint; MetaList!(U2, const U2, immutable U2)) { Sint sn = -1; assertThrown!ConvOverflowException(to!Uint(sn)); } // big signed to small unsigned - foreach (Sint; TypeTuple!(S2, const S2, immutable S2)) - foreach (Uint; TypeTuple!(U1, const U1, immutable U1)) + foreach (Sint; MetaList!(S2, const S2, immutable S2)) + foreach (Uint; MetaList!(U1, const U1, immutable U1)) { Sint sn = -1; assertThrown!ConvOverflowException(to!Uint(sn)); @@ -752,8 +752,8 @@ T toImpl(T, S)(S value) class C : B, I, J {} class D : I {} - foreach (m1; TypeTuple!(0,1,2,3,4)) // enumerate modifiers - foreach (m2; TypeTuple!(0,1,2,3,4)) // ditto + foreach (m1; MetaList!(0,1,2,3,4)) // enumerate modifiers + foreach (m2; MetaList!(0,1,2,3,4)) // ditto (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 alias srcmod = AddModifier!m1; alias tgtmod = AddModifier!m2; @@ -962,15 +962,15 @@ if (is (T == immutable) && isExactSomeString!T && is(S == enum)) void dg() { // string to string conversion - alias Chars = TypeTuple!(char, wchar, dchar); + alias Chars = MetaList!(char, wchar, dchar); foreach (LhsC; Chars) { - alias LhStrings = TypeTuple!(LhsC[], const(LhsC)[], immutable(LhsC)[]); + alias LhStrings = MetaList!(LhsC[], const(LhsC)[], immutable(LhsC)[]); foreach (Lhs; LhStrings) { foreach (RhsC; Chars) { - alias RhStrings = TypeTuple!(RhsC[], const(RhsC)[], immutable(RhsC)[]); + alias RhStrings = MetaList!(RhsC[], const(RhsC)[], immutable(RhsC)[]); foreach (Rhs; RhStrings) { Lhs s1 = to!Lhs("wyda"); @@ -1031,7 +1031,7 @@ if (is (T == immutable) && isExactSomeString!T && is(S == enum)) { // Conversion representing character value with string alias AllChars = - TypeTuple!( char, const( char), immutable( char), + MetaList!( char, const( char), immutable( char), wchar, const(wchar), immutable(wchar), dchar, const(dchar), immutable(dchar)); foreach (Char1; AllChars) @@ -1060,14 +1060,14 @@ if (is (T == immutable) && isExactSomeString!T && is(S == enum)) import std.exception; // Conversion representing integer values with string - foreach (Int; TypeTuple!(ubyte, ushort, uint, ulong)) + foreach (Int; MetaList!(ubyte, ushort, uint, ulong)) { assert(to!string(Int(0)) == "0"); assert(to!string(Int(9)) == "9"); assert(to!string(Int(123)) == "123"); } - foreach (Int; TypeTuple!(byte, short, int, long)) + foreach (Int; MetaList!(byte, short, int, long)) { assert(to!string(Int(0)) == "0"); assert(to!string(Int(9)) == "9"); @@ -1168,7 +1168,7 @@ unittest enum EC : char { a = 'x', b = 'y' } enum ES : string { a = "aaa", b = "bbb" } - foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES)) + foreach (E; MetaList!(EB, EU, EI, EF, EC, ES)) { assert(to! string(E.a) == "a"c); assert(to!wstring(E.a) == "a"w); @@ -1196,7 +1196,7 @@ unittest assert(to!string(E.doo) == "foo"); assert(to!string(E.bar) == "bar"); - foreach (S; TypeTuple!(string, wstring, dstring, const(char[]), const(wchar[]), const(dchar[]))) + foreach (S; MetaList!(string, wstring, dstring, const(char[]), const(wchar[]), const(dchar[]))) { auto s1 = to!S(E.foo); auto s2 = to!S(E.foo); @@ -1205,7 +1205,7 @@ unittest assert(s1 is s2); } - foreach (S; TypeTuple!(char[], wchar[], dchar[])) + foreach (S; MetaList!(char[], wchar[], dchar[])) { auto s1 = to!S(E.foo); auto s2 = to!S(E.foo); @@ -1289,7 +1289,7 @@ body @safe pure nothrow unittest { - foreach (Int; TypeTuple!(uint, ulong)) + foreach (Int; MetaList!(uint, ulong)) { assert(to!string(Int(16), 16) == "10"); assert(to!string(Int(15), 2u) == "1111"); @@ -1299,7 +1299,7 @@ body assert(to!string(Int(0x1234AF), 16u, LetterCase.lower) == "1234af"); } - foreach (Int; TypeTuple!(int, long)) + foreach (Int; MetaList!(int, long)) { assert(to!string(Int(-10), 10u) == "-10"); } @@ -1609,9 +1609,9 @@ private void testFloatingToIntegral(Floating, Integral)() @safe pure unittest { - alias AllInts = TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong); - alias AllFloats = TypeTuple!(float, double, real); - alias AllNumerics = TypeTuple!(AllInts, AllFloats); + alias AllInts = MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong); + alias AllFloats = MetaList!(float, double, real); + alias AllNumerics = MetaList!(AllInts, AllFloats); // test with same type { foreach (T; AllNumerics) @@ -1685,9 +1685,9 @@ private void testFloatingToIntegral(Floating, Integral)() } /*@safe pure */unittest { - alias AllInts = TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong); - alias AllFloats = TypeTuple!(float, double, real); - alias AllNumerics = TypeTuple!(AllInts, AllFloats); + alias AllInts = MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong); + alias AllFloats = MetaList!(float, double, real); + alias AllNumerics = MetaList!(AllInts, AllFloats); // test conversions to string { foreach (T; AllNumerics) @@ -1762,7 +1762,7 @@ T toImpl(T, S)(S value, uint radix) @safe pure unittest { - foreach (Str; TypeTuple!(string, wstring, dstring)) + foreach (Str; MetaList!(string, wstring, dstring)) { Str a = "123"; assert(to!int(a) == 123); @@ -1843,7 +1843,7 @@ unittest { import std.exception; // boundary values - foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint)) + foreach (Int; MetaList!(byte, ubyte, short, ushort, int, uint)) { assert(roundTo!Int(Int.min - 0.4L) == Int.min); assert(roundTo!Int(Int.max + 0.4L) == Int.max); @@ -2022,7 +2022,7 @@ Lerr: @safe pure unittest { - foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (Int; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { { assert(to!Int("0") == 0); @@ -2118,7 +2118,7 @@ Lerr: { import std.exception; // parsing error check - foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (Int; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { { immutable string[] errors1 = @@ -2157,7 +2157,7 @@ Lerr: } // positive overflow check - foreach (i, Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) + foreach (i, Int; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { immutable string[] errors = [ @@ -2175,7 +2175,7 @@ Lerr: } // negative overflow check - foreach (i, Int; TypeTuple!(byte, short, int, long)) + foreach (i, Int; MetaList!(byte, short, int, long)) { immutable string[] errors = [ @@ -2370,7 +2370,7 @@ unittest enum EC : char { a = 'a', b = 'b', c = 'c' } enum ES : string { a = "aaa", b = "bbb", c = "ccc" } - foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES)) + foreach (E; MetaList!(EB, EU, EI, EF, EC, ES)) { assert(to!E("a"c) == E.a); assert(to!E("b"w) == E.b); @@ -2819,7 +2819,7 @@ unittest return f; } - foreach (Float; TypeTuple!(float, double, real)) + foreach (Float; MetaList!(float, double, real)) { assert(to!Float("123") == Literal!Float(123)); assert(to!Float("+123") == Literal!Float(+123)); @@ -3067,9 +3067,9 @@ Target parse(Target, Source)(ref Source s) @safe pure unittest { - foreach (Str; TypeTuple!(string, wstring, dstring)) + foreach (Str; MetaList!(string, wstring, dstring)) { - foreach (Char; TypeTuple!(char, wchar, dchar)) + foreach (Char; MetaList!(char, wchar, dchar)) { static if (is(Unqual!Char == dchar) || Char.sizeof == ElementEncodingType!Str.sizeof) @@ -5169,28 +5169,28 @@ unittest unittest { - foreach(T; TypeTuple!(byte, ubyte)) + foreach(T; MetaList!(byte, ubyte)) { static assert(is(typeof(unsigned(cast(T)1)) == ubyte)); static assert(is(typeof(unsigned(cast(const T)1)) == ubyte)); static assert(is(typeof(unsigned(cast(immutable T)1)) == ubyte)); } - foreach(T; TypeTuple!(short, ushort)) + foreach(T; MetaList!(short, ushort)) { static assert(is(typeof(unsigned(cast(T)1)) == ushort)); static assert(is(typeof(unsigned(cast(const T)1)) == ushort)); static assert(is(typeof(unsigned(cast(immutable T)1)) == ushort)); } - foreach(T; TypeTuple!(int, uint)) + foreach(T; MetaList!(int, uint)) { static assert(is(typeof(unsigned(cast(T)1)) == uint)); static assert(is(typeof(unsigned(cast(const T)1)) == uint)); static assert(is(typeof(unsigned(cast(immutable T)1)) == uint)); } - foreach(T; TypeTuple!(long, ulong)) + foreach(T; MetaList!(long, ulong)) { static assert(is(typeof(unsigned(cast(T)1)) == ulong)); static assert(is(typeof(unsigned(cast(const T)1)) == ulong)); @@ -5207,7 +5207,7 @@ auto unsigned(T)(T x) if (isSomeChar!T) unittest { - foreach(T; TypeTuple!(char, wchar, dchar)) + foreach(T; MetaList!(char, wchar, dchar)) { static assert(is(typeof(unsigned(cast(T)'A')) == T)); static assert(is(typeof(unsigned(cast(const T)'A')) == T)); @@ -5243,28 +5243,28 @@ unittest unittest { - foreach(T; TypeTuple!(byte, ubyte)) + foreach(T; MetaList!(byte, ubyte)) { static assert(is(typeof(signed(cast(T)1)) == byte)); static assert(is(typeof(signed(cast(const T)1)) == byte)); static assert(is(typeof(signed(cast(immutable T)1)) == byte)); } - foreach(T; TypeTuple!(short, ushort)) + foreach(T; MetaList!(short, ushort)) { static assert(is(typeof(signed(cast(T)1)) == short)); static assert(is(typeof(signed(cast(const T)1)) == short)); static assert(is(typeof(signed(cast(immutable T)1)) == short)); } - foreach(T; TypeTuple!(int, uint)) + foreach(T; MetaList!(int, uint)) { static assert(is(typeof(signed(cast(T)1)) == int)); static assert(is(typeof(signed(cast(const T)1)) == int)); static assert(is(typeof(signed(cast(immutable T)1)) == int)); } - foreach(T; TypeTuple!(long, ulong)) + foreach(T; MetaList!(long, ulong)) { static assert(is(typeof(signed(cast(T)1)) == long)); static assert(is(typeof(signed(cast(const T)1)) == long)); diff --git a/std/datetime.d b/std/datetime.d index ac8d63c8f..edcd468a5 100644 --- a/std/datetime.d +++ b/std/datetime.d @@ -31092,7 +31092,7 @@ unittest static auto start() { Rand3Letters retval; retval.popFront(); return retval; } } - foreach(cr; TypeTuple!(function(string a){return cast(char[])a;}, + foreach(cr; MetaList!(function(string a){return cast(char[])a;}, function(string a){return cast(ubyte[])a;}, function(string a){return a;}, function(string a){return map!(b => cast(char)b)(a.representation);})) @@ -31357,7 +31357,7 @@ unittest auto tooLate1 = SysTime(Date(10_000, 1, 1), UTC()); auto tooLate2 = SysTime(DateTime(12_007, 12, 31, 12, 22, 19), UTC()); - foreach(cr; TypeTuple!(function(string a){return cast(char[])a;}, + foreach(cr; MetaList!(function(string a){return cast(char[])a;}, function(string a){return cast(ubyte[])a;}, function(string a){return a;}, function(string a){return map!(b => cast(char)b)(a.representation);})) @@ -31689,7 +31689,7 @@ unittest } static assert(timeStrings.length == 10); - foreach(n; TypeTuple!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) + foreach(n; MetaList!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) mixin(genTest(n)); } @@ -32802,7 +32802,7 @@ unittest import std.typecons; import std.meta; - foreach(cr; TypeTuple!(function(string a){return cast(ubyte[])a;}, + foreach(cr; MetaList!(function(string a){return cast(ubyte[])a;}, function(string a){return map!(b => cast(char)b)(a.representation);})) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 scope(failure) writeln(typeof(cr).stringof); diff --git a/std/encoding.d b/std/encoding.d index 923eca6d9..be0c77c3c 100644 --- a/std/encoding.d +++ b/std/encoding.d @@ -2049,7 +2049,7 @@ unittest string asciiCharString = to!string(iota(0, 128, 1)); - alias Types = TypeTuple!(string, Latin1String, AsciiString, Windows1252String, dstring, wstring); + alias Types = MetaList!(string, Latin1String, AsciiString, Windows1252String, dstring, wstring); foreach(S; Types) foreach(D; Types) { @@ -2064,7 +2064,7 @@ unittest } { string czechChars = "Příliš žluťoučký kůň úpěl ďábelské ódy."; - alias Types = TypeTuple!(string, dstring, wstring); + alias Types = MetaList!(string, dstring, wstring); foreach(S; Types) foreach(D; Types) { diff --git a/std/exception.d b/std/exception.d index 70587c612..b3886896b 100644 --- a/std/exception.d +++ b/std/exception.d @@ -428,11 +428,11 @@ unittest { import std.meta; - foreach (EncloseSafe; TypeTuple!(false, true)) - foreach (EnclosePure; TypeTuple!(false, true)) + foreach (EncloseSafe; MetaList!(false, true)) + foreach (EnclosePure; MetaList!(false, true)) { - foreach (BodySafe; TypeTuple!(false, true)) - foreach (BodyPure; TypeTuple!(false, true)) + foreach (BodySafe; MetaList!(false, true)) + foreach (BodyPure; MetaList!(false, true)) { enum code = "delegate void() " ~ diff --git a/std/file.d b/std/file.d index f84b19711..d25207e19 100644 --- a/std/file.d +++ b/std/file.d @@ -271,7 +271,7 @@ version (Windows) void[] read(in char[] name, size_t upTo = size_t.max) @safe } alias defaults = - TypeTuple!(GENERIC_READ, + MetaList!(GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, (SECURITY_ATTRIBUTES*).init, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, HANDLE.init); @@ -375,7 +375,7 @@ void write(in char[] name, const void[] buffer) @trusted version(Windows) { alias defaults = - TypeTuple!(GENERIC_WRITE, 0, null, CREATE_ALWAYS, + MetaList!(GENERIC_WRITE, 0, null, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, HANDLE.init); auto h = CreateFileW(name.tempCStringW(), defaults); @@ -414,7 +414,7 @@ void append(in char[] name, in void[] buffer) @trusted version(Windows) { alias defaults = - TypeTuple!(GENERIC_WRITE,0,null,OPEN_ALWAYS, + MetaList!(GENERIC_WRITE,0,null,OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,HANDLE.init); auto h = CreateFileW(name.tempCStringW(), defaults); @@ -790,7 +790,7 @@ void setTimes(in char[] name, const ta = SysTimeToFILETIME(accessTime); const tm = SysTimeToFILETIME(modificationTime); alias defaults = - TypeTuple!(GENERIC_WRITE, + MetaList!(GENERIC_WRITE, 0, null, OPEN_EXISTING, diff --git a/std/format.d b/std/format.d index c4ca6645d..4f100b1d5 100644 --- a/std/format.d +++ b/std/format.d @@ -1798,7 +1798,7 @@ unittest @safe /*pure*/ unittest // formatting floating point values is now impure { import std.conv : to; - foreach (T; TypeTuple!(float, double, real)) + foreach (T; MetaList!(float, double, real)) { formatTest( to!( T)(5.5), "5.5" ); formatTest( to!( const T)(5.5), "5.5" ); @@ -1852,13 +1852,13 @@ if (is(Unqual!T : creal) && !is(T == enum) && !hasToString!(T, Char)) @safe /*pure*/ unittest // formatting floating point values is now impure { import std.conv : to; - foreach (T; TypeTuple!(cfloat, cdouble, creal)) + foreach (T; MetaList!(cfloat, cdouble, creal)) { formatTest( to!( T)(1 + 1i), "1+1i" ); formatTest( to!( const T)(1 + 1i), "1+1i" ); formatTest( to!(immutable T)(1 + 1i), "1+1i" ); } - foreach (T; TypeTuple!(cfloat, cdouble, creal)) + foreach (T; MetaList!(cfloat, cdouble, creal)) { formatTest( to!( T)(0 - 3i), "0-3i" ); formatTest( to!( const T)(0 - 3i), "0-3i" ); @@ -1903,7 +1903,7 @@ if (is(Unqual!T : ireal) && !is(T == enum) && !hasToString!(T, Char)) @safe /*pure*/ unittest // formatting floating point values is now impure { import std.conv : to; - foreach (T; TypeTuple!(ifloat, idouble, ireal)) + foreach (T; MetaList!(ifloat, idouble, ireal)) { formatTest( to!( T)(1i), "1i" ); formatTest( to!( const T)(1i), "1i" ); @@ -1949,7 +1949,7 @@ if (is(CharTypeOf!T) && !is(T == enum) && !hasToString!(T, Char)) } else { - alias U = TypeTuple!(ubyte, ushort, uint)[CharTypeOf!T.sizeof/2]; + alias U = MetaList!(ubyte, ushort, uint)[CharTypeOf!T.sizeof/2]; formatValue(w, cast(U) val, f); } } @@ -2275,7 +2275,7 @@ unittest unittest { // string literal from valid UTF sequence is encoding free. - foreach (StrType; TypeTuple!(string, wstring, dstring)) + foreach (StrType; MetaList!(string, wstring, dstring)) { // Valid and printable (ASCII) formatTest( [cast(StrType)"hello"], @@ -4184,7 +4184,7 @@ unittest auto stream = appender!(char[])(); alias AllNumerics = - TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong, + MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong, float, double, real); foreach (T; AllNumerics) { diff --git a/std/functional.d b/std/functional.d index 929d955cc..742a99173 100644 --- a/std/functional.d +++ b/std/functional.d @@ -65,7 +65,7 @@ Distributed under the Boost Software License, Version 1.0. */ module std.functional; -import std.traits, std.typetuple; +import std.traits, std.meta.list; private template needOpCallAlias(alias fun) @@ -110,7 +110,7 @@ template unaryFun(alias fun, string parmName = "a") { static if (!fun._ctfeMatchUnary(parmName)) { - import std.traits, std.typecons, std.typetuple; + import std.traits, std.typecons, std.meta.list; import std.algorithm, std.conv, std.exception, std.math, std.range, std.string; } auto unaryFun(ElementType)(auto ref ElementType __a) @@ -202,7 +202,7 @@ template binaryFun(alias fun, string parm1Name = "a", { static if (!fun._ctfeMatchBinary(parm1Name, parm2Name)) { - import std.traits, std.typecons, std.typetuple; + import std.traits, std.typecons, std.meta.list; import std.algorithm, std.conv, std.exception, std.math, std.range, std.string; } auto binaryFun(ElementType1, ElementType2) @@ -1421,10 +1421,10 @@ template forward(args...) alias fwd = arg; else @property fwd()(){ return move(arg); } - alias forward = TypeTuple!(fwd, forward!(args[1..$])); + alias forward = MetaList!(fwd, forward!(args[1..$])); } else - alias forward = TypeTuple!(); + alias forward = MetaList!(); } /// diff --git a/std/internal/test/dummyrange.d b/std/internal/test/dummyrange.d index 9af5f5919..2d0cfb0f3 100644 --- a/std/internal/test/dummyrange.d +++ b/std/internal/test/dummyrange.d @@ -157,7 +157,7 @@ struct DummyRange(ReturnBy _r, Length _l, RangeType _rt) enum dummyLength = 10; -alias AllDummyRanges = TypeTuple!( +alias AllDummyRanges = MetaList!( DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Forward), DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Bidirectional), DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Random), diff --git a/std/math.d b/std/math.d index 684ad71c3..a6118d790 100644 --- a/std/math.d +++ b/std/math.d @@ -540,13 +540,13 @@ auto abs(Num)(Num y) @safe pure nothrow @nogc @safe pure nothrow @nogc unittest { import std.meta; - foreach (T; TypeTuple!(float, double, real)) + foreach (T; MetaList!(float, double, real)) { T f = 3; assert(abs(f) == f); assert(abs(-f) == f); } - foreach (T; TypeTuple!(cfloat, cdouble, creal)) + foreach (T; MetaList!(cfloat, cdouble, creal)) { T f = -12+3i; assert(abs(f) == hypot(f.re, f.im)); @@ -2453,7 +2453,7 @@ unittest { import std.meta, std.typecons; - foreach (T; TypeTuple!(real, double, float)) + foreach (T; MetaList!(real, double, float)) { Tuple!(T, T, int)[] vals = // x,frexp,exp [ @@ -2506,9 +2506,9 @@ unittest unittest { - import std.meta: TypeTuple; + import std.meta: MetaList; void foo() { - foreach (T; TypeTuple!(real, double, float)) + foreach (T; MetaList!(real, double, float)) { int exp; const T a = 1; @@ -2654,8 +2654,8 @@ float ldexp(float n, int exp) @safe pure nothrow @nogc { return ldexp(cast(real) /// @nogc @safe pure nothrow unittest { - import std.typetuple; - foreach(T; TypeTuple!(float, double, real)) + import std.meta.list; + foreach(T; MetaList!(float, double, real)) { T r; @@ -4649,7 +4649,7 @@ bool isNaN(X)(X x) @nogc @trusted pure nothrow { import std.meta; - foreach(T; TypeTuple!(float, double, real)) + foreach(T; MetaList!(float, double, real)) { // CTFE-able tests assert(isNaN(T.init)); @@ -4812,7 +4812,7 @@ int isSubnormal(X)(X x) @trusted pure nothrow @nogc { import std.meta; - foreach (T; TypeTuple!(float, double, real)) + foreach (T; MetaList!(float, double, real)) { T f; for (f = 1.0; !isSubnormal(f); f /= 2) @@ -5045,9 +5045,9 @@ R copysign(R, X)(X to, R from) @trusted pure nothrow @nogc { import std.meta; - foreach (X; TypeTuple!(float, double, real, int, long)) + foreach (X; MetaList!(float, double, real, int, long)) { - foreach (Y; TypeTuple!(float, double, real)) + foreach (Y; MetaList!(float, double, real)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 X x = 21; Y y = 23.8; diff --git a/std/net/curl.d b/std/net/curl.d index a276d488f..e84bd6e06 100644 --- a/std/net/curl.d +++ b/std/net/curl.d @@ -3635,7 +3635,7 @@ struct Curl copy.stopped = false; with (CurlOption) { - auto tt = TypeTuple!(file, writefunction, writeheader, + auto tt = MetaList!(file, writefunction, writeheader, headerfunction, infile, readfunction, ioctldata, ioctlfunction, seekdata, seekfunction, sockoptdata, diff --git a/std/numeric.d b/std/numeric.d index c88713055..767bcf535 100644 --- a/std/numeric.d +++ b/std/numeric.d @@ -114,9 +114,9 @@ private template CustomFloatParams(uint bits) private template CustomFloatParams(uint precision, uint exponentWidth, CustomFloatFlags flags) { - import std.meta : TypeTuple; + import std.meta : MetaList; alias CustomFloatParams = - TypeTuple!( + MetaList!( precision, exponentWidth, flags, @@ -633,7 +633,7 @@ unittest { import std.meta; alias FPTypes = - TypeTuple!( + MetaList!( CustomFloat!(5, 10), CustomFloat!(5, 11, CustomFloatFlags.ieee ^ CustomFloatFlags.signed), CustomFloat!(1, 15, CustomFloatFlags.ieee ^ CustomFloatFlags.signed), @@ -1449,7 +1449,7 @@ euclideanDistance(Range1, Range2, F)(Range1 a, Range2 b, F limit) unittest { import std.meta; - foreach(T; TypeTuple!(double, const double, immutable double)) + foreach(T; MetaList!(double, const double, immutable double)) { T[] a = [ 1.0, 2.0, ]; T[] b = [ 4.0, 6.0, ]; @@ -1539,7 +1539,7 @@ dotProduct(F1, F2)(in F1[] avector, in F2[] bvector) unittest { import std.meta; - foreach(T; TypeTuple!(double, const double, immutable double)) + foreach(T; MetaList!(double, const double, immutable double)) { T[] a = [ 1.0, 2.0, ]; T[] b = [ 4.0, 6.0, ]; @@ -1583,7 +1583,7 @@ cosineSimilarity(Range1, Range2)(Range1 a, Range2 b) unittest { import std.meta; - foreach(T; TypeTuple!(double, const double, immutable double)) + foreach(T; MetaList!(double, const double, immutable double)) { T[] a = [ 1.0, 2.0, ]; T[] b = [ 4.0, 3.0, ]; @@ -1733,7 +1733,7 @@ if (isInputRange!Range && unittest { import std.meta; - foreach(T; TypeTuple!(double, const double, immutable double)) + foreach(T; MetaList!(double, const double, immutable double)) { T[] p = [ 0.0, 0, 0, 1 ]; assert(entropy(p) == 0); diff --git a/std/parallelism.d b/std/parallelism.d index a1a158a56..4c81d608f 100644 --- a/std/parallelism.d +++ b/std/parallelism.d @@ -2510,7 +2510,7 @@ public: // since we're assuming functions are associative anyhow. // This is so that loops can be unrolled automatically. - enum ilpTuple = TypeTuple!(0, 1, 2, 3, 4, 5); + enum ilpTuple = MetaList!(0, 1, 2, 3, 4, 5); enum nILP = ilpTuple.length; immutable subSize = (upperBound - lowerBound) / nILP; diff --git a/std/path.d b/std/path.d index 862f7add6..85481cb10 100644 --- a/std/path.d +++ b/std/path.d @@ -2692,7 +2692,7 @@ unittest else static assert (0); import std.meta; - foreach (T; TypeTuple!(char[], const(char)[], string, wchar[], + foreach (T; MetaList!(char[], const(char)[], string, wchar[], const(wchar)[], wstring, dchar[], const(dchar)[], dstring)) { foreach (fn; valid) diff --git a/std/random.d b/std/random.d index b64c2725b..b815fe1db 100644 --- a/std/random.d +++ b/std/random.d @@ -67,7 +67,7 @@ import std.traits; version(unittest) { static import std.meta; - package alias PseudoRngTypes = TypeTuple!(MinstdRand0, MinstdRand, Mt19937, Xorshift32, Xorshift64, + package alias PseudoRngTypes = MetaList!(MinstdRand0, MinstdRand, Mt19937, Xorshift32, Xorshift64, Xorshift96, Xorshift128, Xorshift160, Xorshift192); } @@ -515,7 +515,7 @@ unittest assert(rnd.front == 399268537); // Check .save works - foreach (Type; TypeTuple!(MinstdRand0, MinstdRand)) + foreach (Type; MetaList!(MinstdRand0, MinstdRand)) { auto rnd1 = Type(unpredictableSeed); auto rnd2 = rnd1.save; @@ -788,7 +788,7 @@ unittest { import std.range; // Check .save works - foreach(Type; TypeTuple!(Mt19937)) + foreach(Type; MetaList!(Mt19937)) { auto gen1 = Type(unpredictableSeed); auto gen2 = gen1.save; @@ -806,7 +806,7 @@ unittest 0x9d2c5680, 15, 0xefc60000, 18); - foreach (R; TypeTuple!(MT!(uint, 32), MT!(ulong, 32), MT!(ulong, 48), MT!(ulong, 64))) + foreach (R; MetaList!(MT!(uint, 32), MT!(ulong, 32), MT!(ulong, 48), MT!(ulong, 64))) auto a = R(); } @@ -1061,7 +1061,7 @@ unittest [0UL, 246875399, 3690007200, 1264581005, 3906711041, 1866187943, 2481925219, 2464530826, 1604040631, 3653403911] ]; - alias XorshiftTypes = TypeTuple!(Xorshift32, Xorshift64, Xorshift96, Xorshift128, Xorshift160, Xorshift192); + alias XorshiftTypes = MetaList!(Xorshift32, Xorshift64, Xorshift96, Xorshift128, Xorshift160, Xorshift192); foreach (I, Type; XorshiftTypes) { @@ -1436,7 +1436,7 @@ if ((isIntegral!(CommonType!(T1, T2)) || isSomeChar!(CommonType!(T1, T2))) && auto c = uniform(0.0, 1.0); assert(0 <= c && c < 1); - foreach (T; TypeTuple!(char, wchar, dchar, byte, ubyte, short, ushort, + foreach (T; MetaList!(char, wchar, dchar, byte, ubyte, short, ushort, int, uint, long, ulong, float, double, real)) { T lo = 0, hi = 100; @@ -1490,7 +1490,7 @@ if ((isIntegral!(CommonType!(T1, T2)) || isSomeChar!(CommonType!(T1, T2))) && auto reproRng = Xorshift(239842); - foreach (T; TypeTuple!(char, wchar, dchar, byte, ubyte, short, + foreach (T; MetaList!(char, wchar, dchar, byte, ubyte, short, ushort, int, uint, long, ulong)) { T lo = T.min + 10, hi = T.max - 10; @@ -1609,7 +1609,7 @@ if (!is(T == enum) && (isIntegral!T || isSomeChar!T)) @safe unittest { - foreach(T; TypeTuple!(char, wchar, dchar, byte, ubyte, short, ushort, + foreach(T; MetaList!(char, wchar, dchar, byte, ubyte, short, ushort, int, uint, long, ulong)) { T init = uniform!T(); @@ -1760,7 +1760,7 @@ body foreach (UniformRNG; PseudoRngTypes) { - foreach (T; TypeTuple!(float, double, real)) + foreach (T; MetaList!(float, double, real)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 UniformRNG rng = UniformRNG(unpredictableSeed); @@ -2199,7 +2199,7 @@ unittest import std.algorithm; import std.conv; int[] a = [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ]; - foreach (UniformRNG; TypeTuple!(void, PseudoRngTypes)) + foreach (UniformRNG; MetaList!(void, PseudoRngTypes)) { static if (is(UniformRNG == void)) { diff --git a/std/range/package.d b/std/range/package.d index 8cac4ba13..23a5d109c 100644 --- a/std/range/package.d +++ b/std/range/package.d @@ -2166,7 +2166,7 @@ auto takeNone(R)(R range) import std.format : format; - foreach(range; TypeTuple!([1, 2, 3, 4, 5], + foreach(range; MetaList!([1, 2, 3, 4, 5], "hello world", "hello world"w, "hello world"d, @@ -2180,7 +2180,7 @@ auto takeNone(R)(R range) static assert(is(typeof(range) == typeof(takeNone(range))), typeof(range).stringof); } - foreach(range; TypeTuple!(NormalStruct([1, 2, 3]), + foreach(range; MetaList!(NormalStruct([1, 2, 3]), InitStruct([1, 2, 3]))) { static assert(takeNone(range).empty, typeof(range).stringof); @@ -4589,7 +4589,7 @@ unittest assert(iota(uint.max, 0u, -1).length == uint.max); // Issue 8920 - foreach (Type; TypeTuple!(byte, ubyte, short, ushort, + foreach (Type; MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong)) { Type val; @@ -4607,7 +4607,7 @@ unittest @safe unittest { - foreach(range; TypeTuple!(iota(2, 27, 4), + foreach(range; MetaList!(iota(2, 27, 4), iota(3, 9), iota(2.7, 12.3, .1), iota(3.2, 9.7))) @@ -6369,12 +6369,12 @@ unittest assert(saved[0 .. 0].empty); assert(saved[3 .. 3].empty); - alias data = TypeTuple!("one", "two", "three", "four"); + alias data = MetaList!("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; MetaList!(2, 3, 4)) { auto values = only(data[0 .. argCount]); alias Values = typeof(values); @@ -6628,7 +6628,7 @@ pure @safe nothrow unittest } } - foreach (DummyType; TypeTuple!(AllDummyRanges, HasSlicing)) + foreach (DummyType; MetaList!(AllDummyRanges, HasSlicing)) { alias R = typeof(enumerate(DummyType.init)); static assert(isInputRange!R); @@ -6694,7 +6694,7 @@ pure @safe nothrow unittest assert(shifted.empty); } - foreach(T; TypeTuple!(ubyte, byte, uint, int)) + foreach(T; MetaList!(ubyte, byte, uint, int)) { auto inf = 42.repeat().enumerate(T.max); alias Inf = typeof(inf); @@ -6721,7 +6721,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; MetaList!(ubyte, ushort, uint, ulong)) { auto enumerated = values.enumerate!T(); static assert(is(typeof(enumerated.front.index) == T)); @@ -6762,7 +6762,7 @@ version(none) // @@@BUG@@@ 10939 } SignedLengthRange svalues; - foreach(Enumerator; TypeTuple!(ubyte, byte, ushort, short, uint, int, ulong, long)) + foreach(Enumerator; MetaList!(ubyte, byte, ushort, short, uint, int, ulong, long)) { assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max)); assertNotThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length)); @@ -6773,7 +6773,7 @@ version(none) // @@@BUG@@@ 10939 assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length + 1)); } - foreach(Enumerator; TypeTuple!(byte, short, int)) + foreach(Enumerator; MetaList!(byte, short, int)) { assertThrown!RangeError(repeat(0, uint.max).enumerate!Enumerator()); } @@ -8597,14 +8597,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; MetaList!(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; MetaList!(string, wstring, dstring)) { auto appSink = appender!StringType(); auto appResult = txt.tee(appSink).array; diff --git a/std/range/primitives.d b/std/range/primitives.d index 0bcd27ffc..a67431084 100644 --- a/std/range/primitives.d +++ b/std/range/primitives.d @@ -538,7 +538,7 @@ unittest putChar(p, cast(dchar)'a'); //Source Char - foreach (SC; TypeTuple!(char, wchar, dchar)) + foreach (SC; MetaList!(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; MetaList!(char, wchar, dchar)) { //Testing PutC and PutS - foreach (Type; TypeTuple!(PutC!TC, PutS!TC)) + foreach (Type; MetaList!(PutC!TC, PutS!TC)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 Type type; auto sink = new Type(); @@ -642,7 +642,7 @@ unittest } void foo() { - foreach(C; TypeTuple!(char, wchar, dchar)) + foreach(C; MetaList!(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); @@ -2057,7 +2057,7 @@ if (isNarrowString!(C[])) { import std.meta; - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) { S s = "\xC2\xA9hello"; s.popFront(); @@ -2130,7 +2130,7 @@ if (isNarrowString!(T[])) { import std.meta; - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) { S s = "hello\xE2\x89\xA0"; s.popBack(); diff --git a/std/regex/internal/ir.d b/std/regex/internal/ir.d index c9f007379..e30352101 100644 --- a/std/regex/internal/ir.d +++ b/std/regex/internal/ir.d @@ -88,7 +88,7 @@ enum RegexOption: uint { singleline = 0x20 } //do not reorder this list -alias RegexOptionNames = TypeTuple!('g', 'i', 'x', 'U', 'm', 's'); +alias RegexOptionNames = MetaList!('g', 'i', 'x', 'U', 'm', 's'); static assert( RegexOption.max < 0x80); // flags that allow guide execution of engine enum RegexInfo : uint { oneShot = 0x80 } diff --git a/std/regex/internal/kickstart.d b/std/regex/internal/kickstart.d index ad6a8f41e..6e98b751d 100644 --- a/std/regex/internal/kickstart.d +++ b/std/regex/internal/kickstart.d @@ -484,7 +484,7 @@ unittest import std.conv, std.regex; @trusted void test_fixed(alias Kick)() { - foreach(i, v; TypeTuple!(char, wchar, dchar)) + foreach(i, v; MetaList!(char, wchar, dchar)) { alias Char = v; alias String = immutable(v)[]; @@ -510,7 +510,9 @@ unittest } @trusted void test_flex(alias Kick)() { - foreach(i, v;TypeTuple!(char, wchar, dchar)) + import std.meta.list; + + foreach(i, v; MetaList!(char, wchar, dchar)) { alias Char = v; alias String = immutable(v)[]; diff --git a/std/regex/internal/parser.d b/std/regex/internal/parser.d index 48ada5a24..d254af5f1 100644 --- a/std/regex/internal/parser.d +++ b/std/regex/internal/parser.d @@ -155,7 +155,7 @@ unittest } -alias Escapables = TypeTuple!('[', ']', '\\', '^', '$', '.', '|', '?', ',', '-', +alias Escapables = MetaList!('[', ']', '\\', '^', '$', '.', '|', '?', ',', '-', ';', ':', '#', '&', '%', '/', '<', '>', '`', '*', '+', '(', ')', '{', '}', '~'); //test if a given string starts with hex number of maxDigit that's a valid codepoint diff --git a/std/regex/internal/tests.d b/std/regex/internal/tests.d index 8efc6d18b..abdc6cd6e 100644 --- a/std/regex/internal/tests.d +++ b/std/regex/internal/tests.d @@ -343,7 +343,7 @@ unittest void run_tests(alias matchFn)() { int i; - foreach(Char; TypeTuple!( char, wchar, dchar)) + foreach(Char; MetaList!( char, wchar, dchar)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 alias String = immutable(Char)[]; String produceExpected(M,Range)(auto ref M m, Range fmt) @@ -413,7 +413,7 @@ unittest alias Tests = Sequence!(220, tv.length); } else - alias Tests = TypeTuple!(Sequence!(0, 30), Sequence!(235, tv.length-5)); + alias Tests = MetaList!(Sequence!(0, 30), Sequence!(235, tv.length-5)); foreach(a, v; Tests) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 enum tvd = tv[v]; @@ -666,7 +666,7 @@ unittest { import std.uni : toUpper; - foreach(i, v; TypeTuple!(string, wstring, dstring)) + foreach(i, v; MetaList!(string, wstring, dstring)) { auto baz(Cap)(Cap m) if (is(Cap == Captures!(Cap.String))) @@ -749,7 +749,7 @@ unittest } unittest {// bugzilla 7679 - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 enum re = ctRegex!(to!S(r"\.")); auto str = to!S("a.b"); diff --git a/std/regex/package.d b/std/regex/package.d index aefdb9ed4..0859ab83d 100644 --- a/std/regex/package.d +++ b/std/regex/package.d @@ -884,7 +884,7 @@ public auto matchAll(R, RegEx)(R input, RegEx re) import std.conv : to; import std.algorithm : map, equal; - foreach(String; TypeTuple!(string, wstring, const(dchar)[])) + foreach(String; MetaList!(string, wstring, const(dchar)[])) { auto str1 = "blah-bleh".to!String(); auto pat1 = "bl[ae]h".to!String(); @@ -1267,7 +1267,7 @@ public @trusted void replaceAllInto(alias fun, Sink, R, RegEx) { import std.conv; // try and check first/all simple substitution - foreach(S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) + foreach(S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[])) { S s1 = "curt trial".to!S(); S s2 = "round dome".to!S(); diff --git a/std/stdio.d b/std/stdio.d index 9ba153c69..767fb11d9 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -1353,12 +1353,12 @@ void main() { static import std.file; import std.algorithm : equal; - import std.meta : TypeTuple; + import std.meta : MetaList; auto deleteme = testFilename(); std.file.write(deleteme, "hello\nworld\n"); scope(exit) std.file.remove(deleteme); - foreach (String; TypeTuple!(string, char[], wstring, wchar[], dstring, dchar[])) + foreach (String; MetaList!(string, char[], wstring, wchar[], dstring, dchar[])) { auto witness = [ "hello\n", "world\n" ]; auto f = File(deleteme); @@ -1996,7 +1996,7 @@ the contents may well have changed). scope(success) std.file.remove(deleteme); import std.meta; - foreach (T; TypeTuple!(char, wchar, dchar)) + foreach (T; MetaList!(char, wchar, dchar)) { auto blc = File(deleteme).byLine!(T, T); assert(blc.front == "hi"); @@ -3377,7 +3377,7 @@ unittest // stdout.open(file, "w"); // assert(stdout.isOpen); // writefln("Hello, %s world number %s!", "nice", 42); - // foreach (F ; TypeTuple!(ifloat, idouble, ireal)) + // foreach (F ; MetaList!(ifloat, idouble, ireal)) // { // F a = 5i; // F b = a % 2; @@ -3491,7 +3491,7 @@ if (isSomeChar!C && is(Unqual!C == C) && !is(C == enum) && unittest { - import std.meta : TypeTuple; + import std.meta : MetaList; //we can't actually test readln, so at the very least, //we test compilability @@ -3499,12 +3499,12 @@ unittest { readln(); readln('\t'); - foreach (String; TypeTuple!(string, char[], wstring, wchar[], dstring, dchar[])) + foreach (String; MetaList!(string, char[], wstring, wchar[], dstring, dchar[])) { readln!String(); readln!String('\t'); } - foreach (String; TypeTuple!(char[], wchar[], dchar[])) + foreach (String; MetaList!(char[], wchar[], dchar[])) { String buf; readln(buf); @@ -3748,7 +3748,7 @@ struct lines unittest { static import std.file; - import std.meta : TypeTuple; + import std.meta : MetaList; //printf("Entering test at line %d\n", __LINE__); scope(failure) printf("Failed test at line %d\n", __LINE__); @@ -3757,7 +3757,7 @@ unittest scope(exit) { std.file.remove(deleteme); } alias TestedWith = - TypeTuple!(string, wstring, dstring, + MetaList!(string, wstring, dstring, char[], wchar[], dchar[]); foreach (T; TestedWith) { // test looping with an empty file @@ -3800,8 +3800,8 @@ unittest // test with ubyte[] inputs //@@@BUG 2612@@@ - //alias TestedWith2 = TypeTuple!(immutable(ubyte)[], ubyte[]); - alias TestedWith2 = TypeTuple!(immutable(ubyte)[], ubyte[]); + //alias TestedWith2 = MetaList!(immutable(ubyte)[], ubyte[]); + alias TestedWith2 = MetaList!(immutable(ubyte)[], ubyte[]); foreach (T; TestedWith2) { // test looping with an empty file std.file.write(deleteme, ""); @@ -3843,7 +3843,7 @@ unittest } - foreach (T; TypeTuple!(ubyte[])) + foreach (T; MetaList!(ubyte[])) { // test looping with a file with three lines, last without a newline // using a counter too this time diff --git a/std/string.d b/std/string.d index 26541bafc..1d0ed3413 100644 --- a/std/string.d +++ b/std/string.d @@ -482,7 +482,7 @@ ptrdiff_t indexOf(T, size_t n)(ref T[n] s, in dchar c, import std.utf : byChar, byWchar, byDchar; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { assert(indexOf(cast(S)null, cast(dchar)'a') == -1); assert(indexOf(to!S("def"), cast(dchar)'a') == -1); @@ -581,7 +581,7 @@ ptrdiff_t indexOf(Range)(Range s, in dchar c, in size_t startIdx, assert("hello".byWchar.indexOf(cast(dchar)'l', 1) == 2); assert("hello".byWchar.indexOf(cast(dchar)'l', 6) == -1); - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { assert(indexOf(cast(S)null, cast(dchar)'a', 1) == -1); assert(indexOf(to!S("def"), cast(dchar)'a', 1) == -1); @@ -716,9 +716,9 @@ ptrdiff_t indexOf(Range, Char)(Range s, const(Char)[] sub, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(indexOf(cast(S)null, to!T("a")) == -1); assert(indexOf(to!S("def"), to!T("a")) == -1); @@ -808,9 +808,9 @@ ptrdiff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub, import std.conv : to; debug(string) trustedPrintf("string.indexOf(startIdx).unittest\n"); - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) { - foreach(T; TypeTuple!(string, wstring, dstring)) + foreach(T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(indexOf(cast(S)null, to!T("a"), 1337) == -1); assert(indexOf(to!S("def"), to!T("a"), 0) == -1); @@ -938,7 +938,7 @@ ptrdiff_t lastIndexOf(Char)(const(Char)[] s, in dchar c, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { assert(lastIndexOf(cast(S) null, 'a') == -1); assert(lastIndexOf(to!S("def"), 'a') == -1); @@ -998,7 +998,7 @@ ptrdiff_t lastIndexOf(Char)(const(Char)[] s, in dchar c, in size_t startIdx, debug(string) trustedPrintf("string.lastIndexOf.unittest\n"); - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) { assert(lastIndexOf(cast(S) null, 'a') == -1); assert(lastIndexOf(to!S("def"), 'a') == -1); @@ -1118,9 +1118,9 @@ ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 enum typeStr = S.stringof ~ " " ~ T.stringof; @@ -1173,9 +1173,9 @@ ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub, @safe pure unittest // issue13529 { import std.conv : to; - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) { enum typeStr = S.stringof ~ " " ~ T.stringof; auto idx = lastIndexOf(to!T("Hällö Wörldö ö"),to!S("ö ö")); @@ -1215,9 +1215,9 @@ ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub, debug(string) trustedPrintf("string.lastIndexOf.unittest\n"); - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) { - foreach(T; TypeTuple!(string, wstring, dstring)) + foreach(T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 enum typeStr = S.stringof ~ " " ~ T.stringof; @@ -1412,9 +1412,9 @@ ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(indexOfAny(cast(S)null, to!T("a")) == -1); assert(indexOfAny(to!S("def"), to!T("rsa")) == -1); @@ -1495,9 +1495,9 @@ ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles, debug(string) trustedPrintf("string.indexOfAny(startIdx).unittest\n"); - foreach(S; TypeTuple!(string, wstring, dstring)) + foreach(S; MetaList!(string, wstring, dstring)) { - foreach(T; TypeTuple!(string, wstring, dstring)) + foreach(T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(indexOfAny(cast(S)null, to!T("a"), 1337) == -1); assert(indexOfAny(to!S("def"), to!T("AaF"), 0) == -1); @@ -1573,9 +1573,9 @@ ptrdiff_t lastIndexOfAny(Char,Char2)(const(Char)[] haystack, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(lastIndexOfAny(cast(S)null, to!T("a")) == -1); assert(lastIndexOfAny(to!S("def"), to!T("rsa")) == -1); @@ -1669,9 +1669,9 @@ ptrdiff_t lastIndexOfAny(Char,Char2)(const(Char)[] haystack, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 enum typeStr = S.stringof ~ " " ~ T.stringof; @@ -1749,9 +1749,9 @@ ptrdiff_t indexOfNeither(Char,Char2)(const(Char)[] haystack, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(indexOfNeither(cast(S)null, to!T("a")) == -1); assert(indexOfNeither("abba", "a") == 1); @@ -1834,9 +1834,9 @@ ptrdiff_t indexOfNeither(Char,Char2)(const(Char)[] haystack, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(indexOfNeither(cast(S)null, to!T("a"), 1) == -1); assert(indexOfNeither(to!S("def"), to!T("a"), 1) == 1, @@ -1904,9 +1904,9 @@ ptrdiff_t lastIndexOfNeither(Char,Char2)(const(Char)[] haystack, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(lastIndexOfNeither(cast(S)null, to!T("a")) == -1); assert(lastIndexOfNeither(to!S("def"), to!T("rsa")) == 2); @@ -1985,9 +1985,9 @@ ptrdiff_t lastIndexOfNeither(Char,Char2)(const(Char)[] haystack, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { - foreach (T; TypeTuple!(string, wstring, dstring)) + foreach (T; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(lastIndexOfNeither(cast(S)null, to!T("a"), 1337) == -1); assert(lastIndexOfNeither(to!S("def"), to!T("f")) == 1); @@ -2037,7 +2037,7 @@ ptrdiff_t lastIndexOfNeither(Char,Char2)(const(Char)[] haystack, auto representation(Char)(Char[] s) @safe pure nothrow @nogc if (isSomeChar!Char) { - alias ToRepType(T) = TypeTuple!(ubyte, ushort, uint)[T.sizeof / 2]; + alias ToRepType(T) = MetaList!(ubyte, ushort, uint)[T.sizeof / 2]; return cast(ModifyTypePreservingSTC!(ToRepType, Char)[])s; } @@ -2063,7 +2063,7 @@ auto representation(Char)(Char[] s) @safe pure nothrow @nogc assert(representation(str) is cast(T[]) str); } - foreach (Type; TypeTuple!(Tuple!(char , ubyte ), + foreach (Type; MetaList!(Tuple!(char , ubyte ), Tuple!(wchar, ushort), Tuple!(dchar, uint ))) { @@ -2137,7 +2137,7 @@ S capitalize(S)(S s) @trusted pure import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[])) + foreach (S; MetaList!(string, wstring, dstring, char[], wchar[], dchar[])) { S s1 = to!S("FoL"); S s2; @@ -2286,7 +2286,7 @@ S[] splitLines(S)(S s, in KeepTerminator keepTerm = KeepTerminator.no) @safe pur import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { auto s = to!S( "\rpeter\n\rpaul\r\njerry\u2028ice\u2029cream\n\nsunday\n" ~ @@ -2517,7 +2517,7 @@ if ((hasSlicing!Range && hasLength!Range) || import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { auto s = to!S( "\rpeter\n\rpaul\r\njerry\u2028ice\u2029cream\n\n" ~ @@ -2724,7 +2724,7 @@ C[] strip(C)(C[] str) @safe pure import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!( char[], const char[], string, + foreach (S; MetaList!( char[], const char[], string, wchar[], const wchar[], wstring, dchar[], const dchar[], dstring)) { @@ -2909,7 +2909,7 @@ unittest import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { // @@@ BUG IN COMPILER, MUST INSERT CAST assert(chomp(cast(S)null) is null); @@ -2929,7 +2929,7 @@ unittest assert(chomp(to!S("hello\u2029\u2129")) == "hello\u2029\u2129"); assert(chomp(to!S("hello\u2029\u0185")) == "hello\u2029\u0185"); - foreach (T; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (T; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 // @@@ BUG IN COMPILER, MUST INSERT CAST assert(chomp(cast(S)null, cast(T)null) is null); @@ -3004,9 +3004,9 @@ C1[] chompPrefix(C1, C2)(C1[] str, C2[] delimiter) @safe pure import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { - foreach (T; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (T; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(equal(chompPrefix(to!S("abcdefgh"), to!T("abcde")), "fgh")); assert(equal(chompPrefix(to!S("abcde"), to!T("abcdefgh")), "abcde")); @@ -3060,7 +3060,7 @@ unittest import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { assert(chop(cast(S) null) is null); assert(equal(chop(to!S("hello")), "hell")); @@ -3200,7 +3200,7 @@ S center(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { S s = to!S("hello"); @@ -3301,7 +3301,7 @@ S detab(S)(S s, size_t tabSize = 8) @trusted pure import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + foreach (S; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { S s = to!S("This \tis\t a fofof\tof list"); assert(cmp(detab(s), "This is a fofof of list") == 0); @@ -3711,7 +3711,7 @@ C1[] translate(C1, C2 = immutable char)(C1[] str, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!( char[], const( char)[], immutable( char)[], + foreach (S; MetaList!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) { @@ -3725,11 +3725,11 @@ C1[] translate(C1, C2 = immutable char)(C1[] str, to!S("hell0 o w0rld")); assert(translate(to!S("hello world"), cast(dchar[dchar])null) == to!S("hello world")); - foreach (T; TypeTuple!( char[], const( char)[], immutable( char)[], + foreach (T; MetaList!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 - foreach(R; TypeTuple!(dchar[dchar], const dchar[dchar], + foreach(R; MetaList!(dchar[dchar], const dchar[dchar], immutable dchar[dchar])) { R tt = ['h' : 'q', 'l' : '5']; @@ -3768,7 +3768,7 @@ C1[] translate(C1, S, C2 = immutable char)(C1[] str, import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!( char[], const( char)[], immutable( char)[], + foreach (S; MetaList!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) { @@ -3786,12 +3786,12 @@ C1[] translate(C1, S, C2 = immutable char)(C1[] str, to!S("hello world")); assert(translate(to!S("hello world"), cast(string[dchar])null) == to!S("hello world")); - foreach (T; TypeTuple!( char[], const( char)[], immutable( char)[], + foreach (T; MetaList!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 - foreach(R; TypeTuple!(string[dchar], const string[dchar], + foreach(R; MetaList!(string[dchar], const string[dchar], immutable string[dchar])) { R tt = ['h' : "yellow", 'l' : "42"]; @@ -4031,7 +4031,7 @@ body import std.exception; assertCTFEable!( { - foreach (C; TypeTuple!(char, const char, immutable char)) + foreach (C; MetaList!(char, const char, immutable char)) { assert(translate!C("hello world", makeTransTable("hl", "q5")) == to!(C[])("qe55o wor5d")); @@ -4040,7 +4040,7 @@ body static assert(is(typeof(s) == typeof(translate!C(s, transTable)))); } - foreach (S; TypeTuple!(char[], const(char)[], immutable(char)[])) + foreach (S; MetaList!(char[], const(char)[], immutable(char)[])) { assert(translate(to!S("hello world"), makeTransTable("hl", "q5")) == to!S("qe55o wor5d")); assert(translate(to!S("hello \U00010143 world"), makeTransTable("hl", "q5")) == @@ -4051,7 +4051,7 @@ body assert(translate(to!S("hello \U00010143 world"), makeTransTable("12345", "67890")) == to!S("hello \U00010143 world")); - foreach (T; TypeTuple!(char[], const(char)[], immutable(char)[])) + foreach (T; MetaList!(char[], const(char)[], immutable(char)[])) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(translate(to!S("hello world"), makeTransTable("hl", "q5"), to!T("r")) == to!S("qe55o wo5d")); @@ -4654,13 +4654,13 @@ unittest import std.algorithm : equal; // Complete list of test types; too slow to test'em all - // alias TestTypes = TypeTuple!( + // alias TestTypes = MetaList!( // char[], const( char)[], immutable( char)[], // wchar[], const(wchar)[], immutable(wchar)[], // dchar[], const(dchar)[], immutable(dchar)[]); // Reduced list of test types - alias TestTypes = TypeTuple!(char[], const(wchar)[], immutable(dchar)[]); + alias TestTypes = MetaList!(char[], const(wchar)[], immutable(dchar)[]); import std.exception; assertCTFEable!( @@ -5587,7 +5587,7 @@ S[] outdent(S)(S[] lines) @safe pure if(isSomeString!S) assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { enum S blank = ""; assert(blank.outdent() == blank); @@ -5666,7 +5666,7 @@ auto assumeUTF(T)(T[] arr) pure if(staticIndexOf!(Unqual!T, ubyte, ushort, uint) != -1) { import std.utf : validate; - alias ToUTFType(U) = TypeTuple!(char, wchar, dchar)[U.sizeof / 2]; + alias ToUTFType(U) = MetaList!(char, wchar, dchar)[U.sizeof / 2]; auto asUTF = cast(ModifyTypePreservingSTC!(ToUTFType, T)[])arr; debug validate(asUTF); return asUTF; @@ -5685,7 +5685,7 @@ auto assumeUTF(T)(T[] arr) pure pure unittest { import std.algorithm : equal; - foreach(T; TypeTuple!(char[], wchar[], dchar[])) + foreach(T; MetaList!(char[], wchar[], dchar[])) { immutable T jti = "Hello World"; T jt = jti.dup; diff --git a/std/traits.d b/std/traits.d index c8a1d1da7..21374e1f9 100644 --- a/std/traits.d +++ b/std/traits.d @@ -236,25 +236,25 @@ private static if (is(ucent)) { - alias CentTypeList = TypeTuple!(cent, ucent); - alias SignedCentTypeList = TypeTuple!(cent); - alias UnsignedCentTypeList = TypeTuple!(ucent); + alias CentTypeList = MetaList!(cent, ucent); + alias SignedCentTypeList = MetaList!(cent); + alias UnsignedCentTypeList = MetaList!(ucent); } else { - alias CentTypeList = TypeTuple!(); - alias SignedCentTypeList = TypeTuple!(); - alias UnsignedCentTypeList = TypeTuple!(); + alias CentTypeList = MetaList!(); + alias SignedCentTypeList = MetaList!(); + alias UnsignedCentTypeList = MetaList!(); } - alias IntegralTypeList = TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong, CentTypeList); - alias SignedIntTypeList = TypeTuple!(byte, short, int, long, SignedCentTypeList); - alias UnsignedIntTypeList = TypeTuple!(ubyte, ushort, uint, ulong, UnsignedCentTypeList); - alias FloatingPointTypeList = TypeTuple!(float, double, real); - alias ImaginaryTypeList = TypeTuple!(ifloat, idouble, ireal); - alias ComplexTypeList = TypeTuple!(cfloat, cdouble, creal); - alias NumericTypeList = TypeTuple!(IntegralTypeList, FloatingPointTypeList); - alias CharTypeList = TypeTuple!(char, wchar, dchar); + alias IntegralTypeList = MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong, CentTypeList); + alias SignedIntTypeList = MetaList!(byte, short, int, long, SignedCentTypeList); + alias UnsignedIntTypeList = MetaList!(ubyte, ushort, uint, ulong, UnsignedCentTypeList); + alias FloatingPointTypeList = MetaList!(float, double, real); + alias ImaginaryTypeList = MetaList!(ifloat, idouble, ireal); + alias ComplexTypeList = MetaList!(cfloat, cdouble, creal); + alias NumericTypeList = MetaList!(IntegralTypeList, FloatingPointTypeList); + alias CharTypeList = MetaList!(char, wchar, dchar); } package { @@ -304,7 +304,7 @@ package version(unittest) { - alias TypeQualifierList = TypeTuple!(MutableOf, ConstOf, SharedOf, SharedConstOf, ImmutableOf); + alias TypeQualifierList = MetaList!(MutableOf, ConstOf, SharedOf, SharedConstOf, ImmutableOf); struct SubTypeOf(T) { @@ -575,8 +575,8 @@ private template fqnType(T, _inout = 3 } - alias qualifiers = TypeTuple!(is(T == const), is(T == immutable), is(T == shared), is(T == inout)); - alias noQualifiers = TypeTuple!(false, false, false, false); + alias qualifiers = MetaList!(is(T == const), is(T == immutable), is(T == shared), is(T == inout)); + alias noQualifiers = MetaList!(false, false, false, false); string storageClassesString(uint psc)() @property { @@ -920,14 +920,14 @@ unittest unittest { int foo(int i, bool b) { return 0; } - static assert(is(ParameterTypeTuple!foo == TypeTuple!(int, bool))); - static assert(is(ParameterTypeTuple!(typeof(&foo)) == TypeTuple!(int, bool))); + static assert(is(ParameterTypeTuple!foo == MetaList!(int, bool))); + static assert(is(ParameterTypeTuple!(typeof(&foo)) == MetaList!(int, bool))); struct S { real opCall(real r, int i) { return 0.0; } } S s; - static assert(is(ParameterTypeTuple!S == TypeTuple!(real, int))); - static assert(is(ParameterTypeTuple!(S*) == TypeTuple!(real, int))); - static assert(is(ParameterTypeTuple!s == TypeTuple!(real, int))); + static assert(is(ParameterTypeTuple!S == MetaList!(real, int))); + static assert(is(ParameterTypeTuple!(S*) == MetaList!(real, int))); + static assert(is(ParameterTypeTuple!s == MetaList!(real, int))); class Test { @@ -1004,14 +1004,14 @@ template ParameterStorageClassTuple(func...) enum rest = demang.rest; alias demangleNextParameter = - TypeTuple!( + MetaList!( demang.value + 0, // workaround: "not evaluatable at ..." demangleNextParameter!(rest[skip .. $], i + 1) ); } else // went thru all the parameters { - alias demangleNextParameter = TypeTuple!(); + alias demangleNextParameter = MetaList!(); } } @@ -1113,15 +1113,15 @@ template ParameterIdentifierTuple(func...) // Define dummy entities to avoid pointless errors template Get(size_t i) { enum Get = ""; } - alias PT = TypeTuple!(); + alias PT = MetaList!(); } template Impl(size_t i = 0) { static if (i == PT.length) - alias Impl = TypeTuple!(); + alias Impl = MetaList!(); else - alias Impl = TypeTuple!(Get!i, Impl!(i+1)); + alias Impl = MetaList!(Get!i, Impl!(i+1)); } alias ParameterIdentifierTuple = Impl!(); @@ -1207,15 +1207,15 @@ template ParameterDefaultValueTuple(func...) // Define dummy entities to avoid pointless errors template Get(size_t i) { enum Get = ""; } - alias PT = TypeTuple!(); + alias PT = MetaList!(); } template Impl(size_t i = 0) { static if (i == PT.length) - alias Impl = TypeTuple!(); + alias Impl = MetaList!(); else - alias Impl = TypeTuple!(Get!i, Impl!(i+1)); + alias Impl = MetaList!(Get!i, Impl!(i+1)); } alias ParameterDefaultValueTuple = Impl!(); @@ -1238,20 +1238,20 @@ unittest static assert(PDVT!bar.length == 2); static assert(PDVT!bar[0] == 1); static assert(PDVT!bar[1] == "hello"); - static assert(is(typeof(PDVT!bar) == typeof(TypeTuple!(1, "hello")))); + static assert(is(typeof(PDVT!bar) == typeof(MetaList!(1, "hello")))); void baz(int x, int n = 1, string s = "hello"){} static assert(PDVT!baz.length == 3); static assert(is(PDVT!baz[0] == void)); static assert( PDVT!baz[1] == 1); static assert( PDVT!baz[2] == "hello"); - static assert(is(typeof(PDVT!baz) == typeof(TypeTuple!(void, 1, "hello")))); + static assert(is(typeof(PDVT!baz) == typeof(MetaList!(void, 1, "hello")))); // bug 10800 - property functions return empty string @property void foo(int x = 3) { } static assert(PDVT!foo.length == 1); static assert(PDVT!foo[0] == 3); - static assert(is(typeof(PDVT!foo) == typeof(TypeTuple!(3)))); + static assert(is(typeof(PDVT!foo) == typeof(MetaList!(3)))); struct Colour { @@ -1874,7 +1874,7 @@ unittest int test(int); int test() @property; } - alias ov = TypeTuple!(__traits(getVirtualFunctions, Overloads, "test")); + alias ov = MetaList!(__traits(getVirtualFunctions, Overloads, "test")); alias F_ov0 = FunctionTypeOf!(ov[0]); alias F_ov1 = FunctionTypeOf!(ov[1]); alias F_ov2 = FunctionTypeOf!(ov[2]); @@ -2011,10 +2011,10 @@ unittest import std.algorithm : reduce; alias FA = FunctionAttribute; - foreach (BaseT; TypeTuple!(typeof(&sc), typeof(&novar), typeof(&cstyle), + foreach (BaseT; MetaList!(typeof(&sc), typeof(&novar), typeof(&cstyle), typeof(&dstyle), typeof(&typesafe))) { - foreach (T; TypeTuple!(BaseT, FunctionTypeOf!BaseT)) + foreach (T; MetaList!(BaseT, FunctionTypeOf!BaseT)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 enum linkage = functionLinkage!T; enum attrs = functionAttributes!T; @@ -2025,7 +2025,7 @@ unittest // Check that all linkage types work (D-style variadics require D linkage). static if (variadicFunctionStyle!T != Variadic.d) { - foreach (newLinkage; TypeTuple!("D", "C", "Windows", "Pascal", "C++")) + foreach (newLinkage; MetaList!("D", "C", "Windows", "Pascal", "C++")) { alias New = SetFunctionAttributes!(T, newLinkage, attrs); static assert(functionLinkage!New == newLinkage, @@ -2172,36 +2172,36 @@ template FieldTypeTuple(T) else static if (is(T == class)) alias FieldTypeTuple = typeof(T.tupleof); else - alias FieldTypeTuple = TypeTuple!T; + alias FieldTypeTuple = MetaList!T; } /// unittest { struct S { int x; float y; } - static assert(is(FieldTypeTuple!S == TypeTuple!(int, float))); + static assert(is(FieldTypeTuple!S == MetaList!(int, float))); } unittest { - static assert(is(FieldTypeTuple!int == TypeTuple!int)); + static assert(is(FieldTypeTuple!int == MetaList!int)); static struct StaticStruct1 { } - static assert(is(FieldTypeTuple!StaticStruct1 == TypeTuple!())); + static assert(is(FieldTypeTuple!StaticStruct1 == MetaList!())); static struct StaticStruct2 { int a, b; } - static assert(is(FieldTypeTuple!StaticStruct2 == TypeTuple!(int, int))); + static assert(is(FieldTypeTuple!StaticStruct2 == MetaList!(int, int))); int i; struct NestedStruct1 { void f() { ++i; } } - static assert(is(FieldTypeTuple!NestedStruct1 == TypeTuple!())); + static assert(is(FieldTypeTuple!NestedStruct1 == MetaList!())); struct NestedStruct2 { int a; void f() { ++i; } } - static assert(is(FieldTypeTuple!NestedStruct2 == TypeTuple!int)); + static assert(is(FieldTypeTuple!NestedStruct2 == MetaList!int)); class NestedClass { int a; void f() { ++i; } } - static assert(is(FieldTypeTuple!NestedClass == TypeTuple!int)); + static assert(is(FieldTypeTuple!NestedClass == MetaList!int)); } @@ -2222,37 +2222,37 @@ template FieldNameTuple(T) else static if (is(T == class)) alias FieldNameTuple = staticMap!(NameOf, T.tupleof); else - alias FieldNameTuple = TypeTuple!""; + alias FieldNameTuple = MetaList!""; } /// unittest { struct S { int x; float y; } - static assert(FieldNameTuple!S == TypeTuple!("x", "y")); - static assert(FieldNameTuple!int == TypeTuple!""); + static assert(FieldNameTuple!S == MetaList!("x", "y")); + static assert(FieldNameTuple!int == MetaList!""); } unittest { - static assert(FieldNameTuple!int == TypeTuple!""); + static assert(FieldNameTuple!int == MetaList!""); static struct StaticStruct1 { } - static assert(is(FieldNameTuple!StaticStruct1 == TypeTuple!())); + static assert(is(FieldNameTuple!StaticStruct1 == MetaList!())); static struct StaticStruct2 { int a, b; } - static assert(FieldNameTuple!StaticStruct2 == TypeTuple!("a", "b")); + static assert(FieldNameTuple!StaticStruct2 == MetaList!("a", "b")); int i; struct NestedStruct1 { void f() { ++i; } } - static assert(is(FieldNameTuple!NestedStruct1 == TypeTuple!())); + static assert(is(FieldNameTuple!NestedStruct1 == MetaList!())); struct NestedStruct2 { int a; void f() { ++i; } } - static assert(FieldNameTuple!NestedStruct2 == TypeTuple!"a"); + static assert(FieldNameTuple!NestedStruct2 == MetaList!"a"); class NestedClass { int a; void f() { ++i; } } - static assert(FieldNameTuple!NestedClass == TypeTuple!"a"); + static assert(FieldNameTuple!NestedClass == MetaList!"a"); } @@ -2266,7 +2266,7 @@ template RepresentationTypeTuple(T) { static if (T.length == 0) { - alias Impl = TypeTuple!(); + alias Impl = MetaList!(); } else { @@ -2285,7 +2285,7 @@ template RepresentationTypeTuple(T) } else { - alias Impl = TypeTuple!(T[0], Impl!(T[1 .. $])); + alias Impl = MetaList!(T[0], Impl!(T[1 .. $])); } } } @@ -2314,14 +2314,14 @@ unittest unittest { alias S1 = RepresentationTypeTuple!int; - static assert(is(S1 == TypeTuple!int)); + static assert(is(S1 == MetaList!int)); struct S2 { int a; } struct S3 { int a; char b; } struct S4 { S1 a; int b; S3 c; } - static assert(is(RepresentationTypeTuple!S2 == TypeTuple!int)); - static assert(is(RepresentationTypeTuple!S3 == TypeTuple!(int, char))); - static assert(is(RepresentationTypeTuple!S4 == TypeTuple!(int, int, int, char))); + static assert(is(RepresentationTypeTuple!S2 == MetaList!int)); + static assert(is(RepresentationTypeTuple!S3 == MetaList!(int, char))); + static assert(is(RepresentationTypeTuple!S4 == MetaList!(int, int, int, char))); struct S11 { int a; float b; } struct S21 { char[] a; union { S11 b; S11 * c; } } @@ -3404,7 +3404,7 @@ template EnumMembers(E) static if (names.length > 0) { alias EnumSpecificMembers = - TypeTuple!( + MetaList!( WithIdentifier!(names[0]) .Symbolize!(__traits(getMember, E, names[0])), EnumSpecificMembers!(names[1 .. $]) @@ -3412,7 +3412,7 @@ template EnumMembers(E) } else { - alias EnumSpecificMembers = TypeTuple!(); + alias EnumSpecificMembers = MetaList!(); } } @@ -3465,7 +3465,7 @@ unittest //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::// /*** - * Get a $(D_PARAM TypeTuple) of the base class and base interfaces of + * Get a $(D_PARAM MetaList) of the base class and base interfaces of * this class or interface. $(D_PARAM BaseTypeTuple!Object) returns * the empty type tuple. */ @@ -3483,11 +3483,11 @@ unittest interface I1 { } interface I2 { } interface I12 : I1, I2 { } - static assert(is(BaseTypeTuple!I12 == TypeTuple!(I1, I2))); + static assert(is(BaseTypeTuple!I12 == MetaList!(I1, I2))); interface I3 : I1 { } interface I123 : I1, I2, I3 { } - static assert(is(BaseTypeTuple!I123 == TypeTuple!(I1, I2, I3))); + static assert(is(BaseTypeTuple!I123 == MetaList!(I1, I2, I3))); } unittest @@ -3507,7 +3507,7 @@ unittest } /** - * Get a $(D_PARAM TypeTuple) of $(I all) base classes of this class, + * Get a $(D_PARAM MetaList) of $(I all) base classes of this class, * in decreasing order. Interfaces are not included. $(D_PARAM * BaseClassesTuple!Object) yields the empty type tuple. */ @@ -3516,16 +3516,16 @@ template BaseClassesTuple(T) { static if (is(T == Object)) { - alias BaseClassesTuple = TypeTuple!(); + alias BaseClassesTuple = MetaList!(); } else static if (is(BaseTypeTuple!T[0] == Object)) { - alias BaseClassesTuple = TypeTuple!Object; + alias BaseClassesTuple = MetaList!Object; } else { alias BaseClassesTuple = - TypeTuple!(BaseTypeTuple!T[0], + MetaList!(BaseTypeTuple!T[0], BaseClassesTuple!(BaseTypeTuple!T[0])); } } @@ -3537,9 +3537,9 @@ unittest class C2 : C1 { } class C3 : C2 { } static assert(!BaseClassesTuple!Object.length); - static assert(is(BaseClassesTuple!C1 == TypeTuple!(Object))); - static assert(is(BaseClassesTuple!C2 == TypeTuple!(C1, Object))); - static assert(is(BaseClassesTuple!C3 == TypeTuple!(C2, C1, Object))); + static assert(is(BaseClassesTuple!C1 == MetaList!(Object))); + static assert(is(BaseClassesTuple!C2 == MetaList!(C1, Object))); + static assert(is(BaseClassesTuple!C3 == MetaList!(C2, C1, Object))); static assert(!BaseClassesTuple!Object.length); } @@ -3551,11 +3551,11 @@ unittest static assert(!__traits(compiles, BaseClassesTuple!I)); class C4 : I { } class C5 : C4, I { } - static assert(is(BaseClassesTuple!C5 == TypeTuple!(C4, Object))); + static assert(is(BaseClassesTuple!C5 == MetaList!(C4, Object))); } /** - * Get a $(D_PARAM TypeTuple) of $(I all) interfaces directly or + * Get a $(D_PARAM MetaList) of $(I all) interfaces directly or * indirectly inherited by this class or interface. Interfaces do not * repeat if multiply implemented. $(D_PARAM InterfacesTuple!Object) * yields the empty type tuple. @@ -3566,12 +3566,12 @@ template InterfacesTuple(T) { static if (T.length) { - alias Flatten = TypeTuple!(Flatten!H, Flatten!T); + alias Flatten = MetaList!(Flatten!H, Flatten!T); } else { static if (is(H == interface)) - alias Flatten = TypeTuple!(H, InterfacesTuple!H); + alias Flatten = MetaList!(H, InterfacesTuple!H); else alias Flatten = InterfacesTuple!H; } @@ -3580,7 +3580,7 @@ template InterfacesTuple(T) static if (is(T S == super) && S.length) alias InterfacesTuple = NoDuplicates!(Flatten!S); else - alias InterfacesTuple = TypeTuple!(); + alias InterfacesTuple = MetaList!(); } unittest @@ -3608,14 +3608,14 @@ unittest class B2 : J {} class C2 : B2, Ia, Ib {} static assert(is(InterfacesTuple!I == - TypeTuple!(Ia, Iaa, Iab, Ib, Iba, Ibb))); + MetaList!(Ia, Iaa, Iab, Ib, Iba, Ibb))); static assert(is(InterfacesTuple!C2 == - TypeTuple!(J, Ia, Iaa, Iab, Ib, Iba, Ibb))); + MetaList!(J, Ia, Iaa, Iab, Ib, Iba, Ibb))); } /** - * Get a $(D_PARAM TypeTuple) of $(I all) base classes of $(D_PARAM + * Get a $(D_PARAM MetaList) of $(I all) base classes of $(D_PARAM * T), in decreasing order, followed by $(D_PARAM T)'s * interfaces. $(D_PARAM TransitiveBaseTypeTuple!Object) yields the * empty type tuple. @@ -3623,10 +3623,10 @@ unittest template TransitiveBaseTypeTuple(T) { static if (is(T == Object)) - alias TransitiveBaseTypeTuple = TypeTuple!(); + alias TransitiveBaseTypeTuple = MetaList!(); else alias TransitiveBaseTypeTuple = - TypeTuple!(BaseClassesTuple!T, InterfacesTuple!T); + MetaList!(BaseClassesTuple!T, InterfacesTuple!T); } /// @@ -3667,28 +3667,28 @@ template MemberFunctionsTuple(C, string name) static if (__traits(hasMember, Node, name) && __traits(compiles, __traits(getMember, Node, name))) { // Get all overloads in sight (not hidden). - alias TypeTuple!(__traits(getVirtualFunctions, Node, name)) inSight; + alias MetaList!(__traits(getVirtualFunctions, Node, name)) inSight; // And collect all overloads in ancestor classes to reveal hidden // methods. The result may contain duplicates. template walkThru(Parents...) { static if (Parents.length > 0) - alias TypeTuple!( + alias MetaList!( CollectOverloads!(Parents[0]), walkThru!(Parents[1 .. $]) ) walkThru; else - alias TypeTuple!() walkThru; + alias MetaList!() walkThru; } static if (is(Node Parents == super)) - alias TypeTuple!(inSight, walkThru!Parents) CollectOverloads; + alias MetaList!(inSight, walkThru!Parents) CollectOverloads; else - alias TypeTuple!inSight CollectOverloads; + alias MetaList!inSight CollectOverloads; } else - alias TypeTuple!() CollectOverloads; // no overloads in this hierarchy + alias MetaList!() CollectOverloads; // no overloads in this hierarchy } // duplicates in this tuple will be removed by shrink() @@ -3714,13 +3714,13 @@ template MemberFunctionsTuple(C, string name) alias shrinkOne!(rest[0], rest[1 .. $]) shrinkOne; else // target and rest[0] are distinct. - alias TypeTuple!( + alias MetaList!( shrinkOne!(target, rest[1 .. $]), rest[0] // keep ) shrinkOne; } else - alias TypeTuple!target shrinkOne; // done + alias MetaList!target shrinkOne; // done } /* @@ -3731,17 +3731,17 @@ template MemberFunctionsTuple(C, string name) static if (overloads.length > 0) { alias shrinkOne!overloads temp; - alias TypeTuple!(temp[0], shrink!(temp[1 .. $])) shrink; + alias MetaList!(temp[0], shrink!(temp[1 .. $])) shrink; } else - alias TypeTuple!() shrink; // done + alias MetaList!() shrink; // done } // done. alias shrink!overloads MemberFunctionsTuple; } else - alias TypeTuple!() MemberFunctionsTuple; + alias MetaList!() MemberFunctionsTuple; } /// @@ -3848,7 +3848,7 @@ unittest /** -Returns a $(D TypeTuple) of the template arguments used to instantiate $(D T). +Returns a $(D MetaList) of the template arguments used to instantiate $(D T). */ template TemplateArgsOf(alias T : Base!Args, alias Base, Args...) { @@ -3865,7 +3865,7 @@ template TemplateArgsOf(T : Base!Args, alias Base, Args...) unittest { struct Foo(T, U) {} - static assert(is(TemplateArgsOf!(Foo!(int, real)) == TypeTuple!(int, real))); + static assert(is(TemplateArgsOf!(Foo!(int, real)) == MetaList!(int, real))); } unittest @@ -3882,15 +3882,15 @@ unittest enum x = 123; enum y = "123"; - static assert(is(TemplateArgsOf!(Foo1!(int)) == TypeTuple!(int))); - static assert(is(TemplateArgsOf!(Foo2!(int, int)) == TypeTuple!(int, int))); - static assert(__traits(isSame, TemplateArgsOf!(Foo3!(x)), TypeTuple!(x))); - static assert(TemplateArgsOf!(Foo4!(y)) == TypeTuple!(y)); - static assert(is(TemplateArgsOf!(Foo5!(int)) == TypeTuple!(int))); - static assert(is(TemplateArgsOf!(Foo6!(int, int)) == TypeTuple!(int, int))); - static assert(__traits(isSame, TemplateArgsOf!(Foo7!(x)), TypeTuple!(x))); - static assert(is(TemplateArgsOf!(Foo8!(int).Foo9!(real)) == TypeTuple!(real))); - static assert(is(TemplateArgsOf!(Foo10!()) == TypeTuple!())); + static assert(is(TemplateArgsOf!(Foo1!(int)) == MetaList!(int))); + static assert(is(TemplateArgsOf!(Foo2!(int, int)) == MetaList!(int, int))); + static assert(__traits(isSame, TemplateArgsOf!(Foo3!(x)), MetaList!(x))); + static assert(TemplateArgsOf!(Foo4!(y)) == MetaList!(y)); + static assert(is(TemplateArgsOf!(Foo5!(int)) == MetaList!(int))); + static assert(is(TemplateArgsOf!(Foo6!(int, int)) == MetaList!(int, int))); + static assert(__traits(isSame, TemplateArgsOf!(Foo7!(x)), MetaList!(x))); + static assert(is(TemplateArgsOf!(Foo8!(int).Foo9!(real)) == MetaList!(real))); + static assert(is(TemplateArgsOf!(Foo10!()) == MetaList!())); } @@ -3995,62 +3995,62 @@ template ImplicitConversionTargets(T) { static if (is(T == bool)) alias ImplicitConversionTargets = - TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong, CentTypeList, + MetaList!(byte, ubyte, short, ushort, int, uint, long, ulong, CentTypeList, float, double, real, char, wchar, dchar); else static if (is(T == byte)) alias ImplicitConversionTargets = - TypeTuple!(short, ushort, int, uint, long, ulong, CentTypeList, + MetaList!(short, ushort, int, uint, long, ulong, CentTypeList, float, double, real, char, wchar, dchar); else static if (is(T == ubyte)) alias ImplicitConversionTargets = - TypeTuple!(short, ushort, int, uint, long, ulong, CentTypeList, + MetaList!(short, ushort, int, uint, long, ulong, CentTypeList, float, double, real, char, wchar, dchar); else static if (is(T == short)) alias ImplicitConversionTargets = - TypeTuple!(int, uint, long, ulong, CentTypeList, float, double, real); + MetaList!(int, uint, long, ulong, CentTypeList, float, double, real); else static if (is(T == ushort)) alias ImplicitConversionTargets = - TypeTuple!(int, uint, long, ulong, CentTypeList, float, double, real); + MetaList!(int, uint, long, ulong, CentTypeList, float, double, real); else static if (is(T == int)) alias ImplicitConversionTargets = - TypeTuple!(long, ulong, CentTypeList, float, double, real); + MetaList!(long, ulong, CentTypeList, float, double, real); else static if (is(T == uint)) alias ImplicitConversionTargets = - TypeTuple!(long, ulong, CentTypeList, float, double, real); + MetaList!(long, ulong, CentTypeList, float, double, real); else static if (is(T == long)) - alias ImplicitConversionTargets = TypeTuple!(float, double, real); + alias ImplicitConversionTargets = MetaList!(float, double, real); else static if (is(T == ulong)) - alias ImplicitConversionTargets = TypeTuple!(float, double, real); + alias ImplicitConversionTargets = MetaList!(float, double, real); else static if (is(cent) && is(T == cent)) - alias ImplicitConversionTargets = TypeTuple!(float, double, real); + alias ImplicitConversionTargets = MetaList!(float, double, real); else static if (is(ucent) && is(T == ucent)) - alias ImplicitConversionTargets = TypeTuple!(float, double, real); + alias ImplicitConversionTargets = MetaList!(float, double, real); else static if (is(T == float)) - alias ImplicitConversionTargets = TypeTuple!(double, real); + alias ImplicitConversionTargets = MetaList!(double, real); else static if (is(T == double)) - alias ImplicitConversionTargets = TypeTuple!real; + alias ImplicitConversionTargets = MetaList!real; else static if (is(T == char)) alias ImplicitConversionTargets = - TypeTuple!(wchar, dchar, byte, ubyte, short, ushort, + MetaList!(wchar, dchar, byte, ubyte, short, ushort, int, uint, long, ulong, CentTypeList, float, double, real); else static if (is(T == wchar)) alias ImplicitConversionTargets = - TypeTuple!(dchar, short, ushort, int, uint, long, ulong, CentTypeList, + MetaList!(dchar, short, ushort, int, uint, long, ulong, CentTypeList, float, double, real); else static if (is(T == dchar)) alias ImplicitConversionTargets = - TypeTuple!(int, uint, long, ulong, CentTypeList, float, double, real); + MetaList!(int, uint, long, ulong, CentTypeList, float, double, real); else static if (is(T : typeof(null))) - alias ImplicitConversionTargets = TypeTuple!(typeof(null)); + alias ImplicitConversionTargets = MetaList!(typeof(null)); else static if(is(T : Object)) alias ImplicitConversionTargets = TransitiveBaseTypeTuple!(T); else static if (isDynamicArray!T && !is(typeof(T.init[0]) == const)) alias ImplicitConversionTargets = - TypeTuple!(const(Unqual!(typeof(T.init[0])))[]); + MetaList!(const(Unqual!(typeof(T.init[0])))[]); else static if (is(T : void*)) - alias ImplicitConversionTargets = TypeTuple!(void*); + alias ImplicitConversionTargets = MetaList!(void*); else - alias ImplicitConversionTargets = TypeTuple!(); + alias ImplicitConversionTargets = MetaList!(); } unittest @@ -4537,7 +4537,7 @@ unittest static struct S { } int i; struct Nested { void f() { ++i; } } - foreach(T; TypeTuple!(int, immutable int, inout int, string, S, Nested, Object)) + foreach(T; MetaList!(int, immutable int, inout int, string, S, Nested, Object)) { static assert(!__traits(compiles, needLvalue(rvalueOf!T))); static assert( __traits(compiles, needLvalue(lvalueOf!T))); @@ -4557,7 +4557,7 @@ unittest private template AliasThisTypeOf(T) if (isAggregateType!T) { - alias members = TypeTuple!(__traits(getAliasThis, T)); + alias members = MetaList!(__traits(getAliasThis, T)); static if (members.length == 1) { @@ -4587,14 +4587,14 @@ template BooleanTypeOf(T) unittest { // unexpected failure, maybe dmd type-merging bug - foreach (T; TypeTuple!bool) + foreach (T; MetaList!bool) foreach (Q; TypeQualifierList) { static assert( is(Q!T == BooleanTypeOf!( Q!T ))); static assert( is(Q!T == BooleanTypeOf!( SubTypeOf!(Q!T) ))); } - foreach (T; TypeTuple!(void, NumericTypeList, ImaginaryTypeList, ComplexTypeList, CharTypeList)) + foreach (T; MetaList!(void, NumericTypeList, ImaginaryTypeList, ComplexTypeList, CharTypeList)) foreach (Q; TypeQualifierList) { static assert(!is(BooleanTypeOf!( Q!T )), Q!T.stringof); @@ -4644,7 +4644,7 @@ unittest static assert( is(Q!T == IntegralTypeOf!( SubTypeOf!(Q!T) ))); } - foreach (T; TypeTuple!(void, bool, FloatingPointTypeList, ImaginaryTypeList, ComplexTypeList, CharTypeList)) + foreach (T; MetaList!(void, bool, FloatingPointTypeList, ImaginaryTypeList, ComplexTypeList, CharTypeList)) foreach (Q; TypeQualifierList) { static assert(!is(IntegralTypeOf!( Q!T ))); @@ -4678,7 +4678,7 @@ unittest static assert( is(Q!T == FloatingPointTypeOf!( SubTypeOf!(Q!T) ))); } - foreach (T; TypeTuple!(void, bool, IntegralTypeList, ImaginaryTypeList, ComplexTypeList, CharTypeList)) + foreach (T; MetaList!(void, bool, IntegralTypeList, ImaginaryTypeList, ComplexTypeList, CharTypeList)) foreach (Q; TypeQualifierList) { static assert(!is(FloatingPointTypeOf!( Q!T ))); @@ -4707,7 +4707,7 @@ unittest static assert( is(Q!T == NumericTypeOf!( SubTypeOf!(Q!T) ))); } - foreach (T; TypeTuple!(void, bool, CharTypeList, ImaginaryTypeList, ComplexTypeList)) + foreach (T; MetaList!(void, bool, CharTypeList, ImaginaryTypeList, ComplexTypeList)) foreach (Q; TypeQualifierList) { static assert(!is(NumericTypeOf!( Q!T ))); @@ -4765,14 +4765,14 @@ unittest static assert( is(CharTypeOf!( SubTypeOf!(Q!T) ))); } - foreach (T; TypeTuple!(void, bool, NumericTypeList, ImaginaryTypeList, ComplexTypeList)) + foreach (T; MetaList!(void, bool, NumericTypeList, ImaginaryTypeList, ComplexTypeList)) foreach (Q; TypeQualifierList) { static assert(!is(CharTypeOf!( Q!T ))); static assert(!is(CharTypeOf!( SubTypeOf!(Q!T) ))); } - foreach (T; TypeTuple!(string, wstring, dstring, char[4])) + foreach (T; MetaList!(string, wstring, dstring, char[4])) foreach (Q; TypeQualifierList) { static assert(!is(CharTypeOf!( Q!T ))); @@ -4797,8 +4797,8 @@ template StaticArrayTypeOf(T) unittest { - foreach (T; TypeTuple!(bool, NumericTypeList, ImaginaryTypeList, ComplexTypeList)) - foreach (Q; TypeTuple!(TypeQualifierList, InoutOf, SharedInoutOf)) + foreach (T; MetaList!(bool, NumericTypeList, ImaginaryTypeList, ComplexTypeList)) + foreach (Q; MetaList!(TypeQualifierList, InoutOf, SharedInoutOf)) { static assert(is( Q!( T[1] ) == StaticArrayTypeOf!( Q!( T[1] ) ) )); @@ -4808,8 +4808,8 @@ unittest } } - foreach (T; TypeTuple!void) - foreach (Q; TypeTuple!TypeQualifierList) + foreach (T; MetaList!void) + foreach (Q; MetaList!TypeQualifierList) { static assert(is( StaticArrayTypeOf!( Q!(void[1]) ) == Q!(void[1]) )); } @@ -4834,13 +4834,13 @@ template DynamicArrayTypeOf(T) unittest { - foreach (T; TypeTuple!(/*void, */bool, NumericTypeList, ImaginaryTypeList, ComplexTypeList)) - foreach (Q; TypeTuple!(TypeQualifierList, InoutOf, SharedInoutOf)) + foreach (T; MetaList!(/*void, */bool, NumericTypeList, ImaginaryTypeList, ComplexTypeList)) + foreach (Q; MetaList!(TypeQualifierList, InoutOf, SharedInoutOf)) { static assert(is( Q!T[] == DynamicArrayTypeOf!( Q!T[] ) )); static assert(is( Q!(T[]) == DynamicArrayTypeOf!( Q!(T[]) ) )); - foreach (P; TypeTuple!(MutableOf, ConstOf, ImmutableOf)) + foreach (P; MetaList!(MutableOf, ConstOf, ImmutableOf)) { static assert(is( Q!(P!T[]) == DynamicArrayTypeOf!( Q!(SubTypeOf!(P!T[])) ) )); static assert(is( Q!(P!(T[])) == DynamicArrayTypeOf!( Q!(SubTypeOf!(P!(T[]))) ) )); @@ -4890,7 +4890,7 @@ template StringTypeOf(T) unittest { foreach (T; CharTypeList) - foreach (Q; TypeTuple!(MutableOf, ConstOf, ImmutableOf, InoutOf)) + foreach (Q; MetaList!(MutableOf, ConstOf, ImmutableOf, InoutOf)) { static assert(is(Q!T[] == StringTypeOf!( Q!T[] ))); @@ -4905,7 +4905,7 @@ unittest } foreach (T; CharTypeList) - foreach (Q; TypeTuple!(SharedOf, SharedConstOf, SharedInoutOf)) + foreach (Q; MetaList!(SharedOf, SharedConstOf, SharedInoutOf)) { static assert(!is(StringTypeOf!( Q!T[] ))); } @@ -4935,19 +4935,19 @@ template AssocArrayTypeOf(T) unittest { - foreach (T; TypeTuple!(int/*bool, CharTypeList, NumericTypeList, ImaginaryTypeList, ComplexTypeList*/)) - foreach (P; TypeTuple!(TypeQualifierList, InoutOf, SharedInoutOf)) - foreach (Q; TypeTuple!(TypeQualifierList, InoutOf, SharedInoutOf)) - foreach (R; TypeTuple!(TypeQualifierList, InoutOf, SharedInoutOf)) + foreach (T; MetaList!(int/*bool, CharTypeList, NumericTypeList, ImaginaryTypeList, ComplexTypeList*/)) + foreach (P; MetaList!(TypeQualifierList, InoutOf, SharedInoutOf)) + foreach (Q; MetaList!(TypeQualifierList, InoutOf, SharedInoutOf)) + foreach (R; MetaList!(TypeQualifierList, InoutOf, SharedInoutOf)) { static assert(is( P!(Q!T[R!T]) == AssocArrayTypeOf!( P!(Q!T[R!T]) ) )); } - foreach (T; TypeTuple!(int/*bool, CharTypeList, NumericTypeList, ImaginaryTypeList, ComplexTypeList*/)) - foreach (O; TypeTuple!(TypeQualifierList, InoutOf, SharedInoutOf)) - foreach (P; TypeTuple!TypeQualifierList) - foreach (Q; TypeTuple!TypeQualifierList) - foreach (R; TypeTuple!TypeQualifierList) + foreach (T; MetaList!(int/*bool, CharTypeList, NumericTypeList, ImaginaryTypeList, ComplexTypeList*/)) + foreach (O; MetaList!(TypeQualifierList, InoutOf, SharedInoutOf)) + foreach (P; MetaList!TypeQualifierList) + foreach (Q; MetaList!TypeQualifierList) + foreach (R; MetaList!TypeQualifierList) { static assert(is( O!(P!(Q!T[R!T])) == AssocArrayTypeOf!( O!(SubTypeOf!(P!(Q!T[R!T]))) ) )); } @@ -5021,7 +5021,7 @@ unittest { enum EF : real { a = 1.414, b = 1.732, c = 2.236 } - foreach (T; TypeTuple!(FloatingPointTypeList, EF)) + foreach (T; MetaList!(FloatingPointTypeList, EF)) { foreach (Q; TypeQualifierList) { @@ -5046,7 +5046,7 @@ enum bool isNumeric(T) = is(NumericTypeOf!T) && !isAggregateType!T; unittest { - foreach (T; TypeTuple!(NumericTypeList)) + foreach (T; MetaList!(NumericTypeList)) { foreach (Q; TypeQualifierList) { @@ -5093,7 +5093,7 @@ enum bool isUnsigned(T) = is(UnsignedTypeOf!T) && !isAggregateType!T; unittest { - foreach (T; TypeTuple!(UnsignedIntTypeList)) + foreach (T; MetaList!(UnsignedIntTypeList)) { foreach (Q; TypeQualifierList) { @@ -5110,7 +5110,7 @@ enum bool isSigned(T) = is(SignedTypeOf!T) && !isAggregateType!T; unittest { - foreach (T; TypeTuple!(SignedIntTypeList)) + foreach (T; MetaList!(SignedIntTypeList)) { foreach (Q; TypeQualifierList) { @@ -5140,7 +5140,7 @@ unittest { enum EC : char { a = 'x', b = 'y' } - foreach (T; TypeTuple!(CharTypeList, EC)) + foreach (T; MetaList!(CharTypeList, EC)) { foreach (Q; TypeQualifierList) { @@ -5176,7 +5176,7 @@ unittest unittest { - foreach (T; TypeTuple!(char[], dchar[], string, wstring, dstring)) + foreach (T; MetaList!(char[], dchar[], string, wstring, dstring)) { static assert( isSomeString!( T )); static assert(!isSomeString!(SubTypeOf!(T))); @@ -5193,16 +5193,16 @@ enum bool isNarrowString(T) = (is(T : const char[]) || is(T : const wchar[])) && unittest { - foreach (T; TypeTuple!(char[], string, wstring)) + foreach (T; MetaList!(char[], string, wstring)) { - foreach (Q; TypeTuple!(MutableOf, ConstOf, ImmutableOf)/*TypeQualifierList*/) + foreach (Q; MetaList!(MutableOf, ConstOf, ImmutableOf)/*TypeQualifierList*/) { static assert( isNarrowString!( Q!T )); static assert(!isNarrowString!( SubTypeOf!(Q!T) )); } } - foreach (T; TypeTuple!(int, int[], byte[], dchar[], dstring, char[4])) + foreach (T; MetaList!(int, int[], byte[], dchar[], dstring, char[4])) { foreach (Q; TypeQualifierList) { @@ -5232,7 +5232,7 @@ unittest unittest { - foreach (T; TypeTuple!(int[51], int[][2], + foreach (T; MetaList!(int[51], int[][2], char[][int][11], immutable char[13u], const(real)[1], const(real)[1][1], void[0])) { @@ -5254,7 +5254,7 @@ enum bool isDynamicArray(T) = is(DynamicArrayTypeOf!T) && !isAggregateType!T; unittest { - foreach (T; TypeTuple!(int[], char[], string, long[3][], double[string][])) + foreach (T; MetaList!(int[], char[], string, long[3][], double[string][])) { foreach (Q; TypeQualifierList) { @@ -5278,7 +5278,7 @@ enum bool isArray(T) = isStaticArray!T || isDynamicArray!T; unittest { - foreach (T; TypeTuple!(int[], int[5], void[])) + foreach (T; MetaList!(int[], int[5], void[])) { foreach (Q; TypeQualifierList) { @@ -5305,7 +5305,7 @@ unittest @property uint[] values() { return null; } } - foreach (T; TypeTuple!(int[int], int[string], immutable(char[5])[int])) + foreach (T; MetaList!(int[int], int[string], immutable(char[5])[int])) { foreach (Q; TypeQualifierList) { @@ -5371,7 +5371,7 @@ enum bool isPointer(T) = is(T == U*, U) && !isAggregateType!T; unittest { - foreach (T; TypeTuple!(int*, void*, char[]*)) + foreach (T; MetaList!(int*, void*, char[]*)) { foreach (Q; TypeQualifierList) { @@ -6216,10 +6216,10 @@ unittest /// unittest { - foreach(T; TypeTuple!(bool, byte, short, int, long)) + foreach(T; MetaList!(bool, byte, short, int, long)) static assert(mostNegative!T == T.min); - foreach(T; TypeTuple!(ubyte, ushort, uint, ulong, char, wchar, dchar)) + foreach(T; MetaList!(ubyte, ushort, uint, ulong, char, wchar, dchar)) static assert(mostNegative!T == 0); } diff --git a/std/typecons.d b/std/typecons.d index 10c8ceebb..adc49d030 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -45,7 +45,7 @@ Authors: $(WEB erdani.org, Andrei Alexandrescu), module std.typecons; import std.traits; // FIXME -import std.meta; // : TypeTuple, allSatisfy; +import std.meta; // : MetaList, allSatisfy; debug(Unique) import std.stdio; @@ -410,7 +410,7 @@ for the second, and so on. The choice of zero-based indexing instead of one-base indexing was motivated by the ability to use value `Tuple`s with various compile-time -loop constructs (e.g. $(XREF typetuple, TypeTuple) iteration), all of which use +loop constructs (e.g. $(XREF typetuple, MetaList) iteration), all of which use zero-based indexing. Params: @@ -426,20 +426,20 @@ template Tuple(Specs...) { static if (Specs.length == 0) { - alias parseSpecs = TypeTuple!(); + alias parseSpecs = MetaList!(); } else static if (is(Specs[0])) { static if (is(typeof(Specs[1]) : string)) { alias parseSpecs = - TypeTuple!(FieldSpec!(Specs[0 .. 2]), + MetaList!(FieldSpec!(Specs[0 .. 2]), parseSpecs!(Specs[2 .. $])); } else { alias parseSpecs = - TypeTuple!(FieldSpec!(Specs[0]), + MetaList!(FieldSpec!(Specs[0]), parseSpecs!(Specs[1 .. $])); } } @@ -493,11 +493,11 @@ template Tuple(Specs...) { static if (spec.name.length == 0) { - alias expandSpec = TypeTuple!(spec.Type); + alias expandSpec = MetaList!(spec.Type); } else { - alias expandSpec = TypeTuple!(spec.Type, spec.name); + alias expandSpec = MetaList!(spec.Type, spec.name); } } @@ -547,7 +547,7 @@ template Tuple(Specs...) unittest { alias Fields = Tuple!(int, "id", string, float); - static assert(is(Fields.Types == TypeTuple!(int, string, float))); + static assert(is(Fields.Types == MetaList!(int, string, float))); } /** @@ -559,7 +559,7 @@ template Tuple(Specs...) unittest { alias Fields = Tuple!(int, "id", string, float); - static assert(Fields.fieldNames == TypeTuple!("id", "", "")); + static assert(Fields.fieldNames == MetaList!("id", "", "")); } /** @@ -994,11 +994,11 @@ private template ReverseTupleSpecs(T...) { static if (is(typeof(T[$-1]) : string)) { - alias ReverseTupleSpecs = TypeTuple!(T[$-2], T[$-1], ReverseTupleSpecs!(T[0 .. $-2])); + alias ReverseTupleSpecs = MetaList!(T[$-2], T[$-1], ReverseTupleSpecs!(T[0 .. $-2])); } else { - alias ReverseTupleSpecs = TypeTuple!(T[$-1], ReverseTupleSpecs!(T[0 .. $-1])); + alias ReverseTupleSpecs = MetaList!(T[$-1], ReverseTupleSpecs!(T[0 .. $-1])); } } else @@ -1334,7 +1334,7 @@ unittest static assert(T.fieldNames[1] == "foo"); alias Fields = Tuple!(int, "id", string, float); - static assert(Fields.fieldNames == TypeTuple!("id", "", "")); + static assert(Fields.fieldNames == MetaList!("id", "", "")); } // Bugzilla 13837 @@ -1430,12 +1430,12 @@ template tuple(Names...) { template and(B...) if (B.length == 1) { - alias TypeTuple!(A[0], B[0]) and; + alias MetaList!(A[0], B[0]) and; } template and(B...) if (B.length != 1) { - alias TypeTuple!(A[0], B[0], + alias MetaList!(A[0], B[0], Interleave!(A[1..$]).and!(B[1..$])) and; } } @@ -1720,7 +1720,7 @@ unittest immutable(char[]) s7654; Rebindable!(typeof(s7654)) r7654 = s7654; - foreach (T; TypeTuple!(char, wchar, char, int)) + foreach (T; MetaList!(char, wchar, char, int)) { static assert(is(Rebindable!(immutable(T[])) == immutable(T)[])); static assert(is(Rebindable!(const(T[])) == const(T)[])); @@ -2218,7 +2218,7 @@ unittest ni = other.ni; } } - foreach (S; TypeTuple!(S1, S2)) + foreach (S; MetaList!(S1, S2)) { S a; S b = a; @@ -2589,7 +2589,7 @@ unittest ni = other.ni; } } - foreach (S; TypeTuple!(S1, S2)) + foreach (S; MetaList!(S1, S2)) { S a; S b = a; @@ -2891,7 +2891,7 @@ unittest ni = other.ni; } } - foreach (S; TypeTuple!(S1, S2)) + foreach (S; MetaList!(S1, S2)) { S a; S b = a; @@ -3207,12 +3207,12 @@ private static: alias next = Impl!(names[1 .. $]); static if (methods.length > 0) - alias Impl = TypeTuple!(OverloadSet!(names[0], methods), next); + alias Impl = MetaList!(OverloadSet!(names[0], methods), next); else alias Impl = next; } else - alias Impl = TypeTuple!(); + alias Impl = MetaList!(); } alias enumerateOverloads = Impl!(__traits(allMembers, C)); @@ -3564,9 +3564,9 @@ private static: template CountUp(size_t n) { static if (n > 0) - alias CountUp = TypeTuple!(CountUp!(n - 1), n - 1); + alias CountUp = MetaList!(CountUp!(n - 1), n - 1); else - alias CountUp = TypeTuple!(); + alias CountUp = MetaList!(); } @@ -3705,7 +3705,7 @@ private static: /* Declare keywords: args, self and parent. */ string preamble; - preamble ~= "alias args = TypeTuple!(" ~ enumerateParameters!(nparams) ~ ");\n"; + preamble ~= "alias args = MetaList!(" ~ enumerateParameters!(nparams) ~ ");\n"; if (!isCtor) { preamble ~= "alias self = " ~ name ~ ";\n"; @@ -3918,17 +3918,17 @@ if (Targets.length >= 1 && allSatisfy!(isMutable, Targets)) template Concat(size_t i = 0) { static if (i >= Targets.length) - alias Concat = TypeTuple!(); + alias Concat = MetaList!(); else { - alias Concat = TypeTuple!(GetOverloadedMethods!(Targets[i]), Concat!(i + 1)); + alias Concat = MetaList!(GetOverloadedMethods!(Targets[i]), Concat!(i + 1)); } } // Remove duplicated functions based on the identifier name and function type covariance template Uniq(members...) { static if (members.length == 0) - alias Uniq = TypeTuple!(); + alias Uniq = MetaList!(); else { alias func = members[0]; @@ -3956,14 +3956,14 @@ if (Targets.length >= 1 && allSatisfy!(isMutable, Targets)) !is(DerivedFunctionType!(typex, remain[0].type) == void)) { alias F = DerivedFunctionType!(typex, remain[0].type); - alias Uniq = TypeTuple!(FuncInfo!(name, F), remain[1 .. $]); + alias Uniq = MetaList!(FuncInfo!(name, F), remain[1 .. $]); } else - alias Uniq = TypeTuple!(FuncInfo!(name, typex), remain); + alias Uniq = MetaList!(FuncInfo!(name, typex), remain); } else { - alias Uniq = TypeTuple!(FuncInfo!(name, type), Uniq!(members[1 .. $])); + alias Uniq = MetaList!(FuncInfo!(name, type), Uniq!(members[1 .. $])); } } } @@ -4017,7 +4017,7 @@ if (Targets.length >= 1 && allSatisfy!(isMutable, Targets)) } static @property mod() { - alias type = TypeTuple!(TargetMembers[i].type)[0]; + alias type = MetaList!(TargetMembers[i].type)[0]; string r; static if (is(type == immutable)) r ~= " immutable"; else @@ -4293,12 +4293,12 @@ private template GetOverloadedMethods(T) { import std.meta : Filter; - alias allMembers = TypeTuple!(__traits(allMembers, T)); + alias allMembers = MetaList!(__traits(allMembers, T)); template follows(size_t i = 0) { static if (i >= allMembers.length) { - alias follows = TypeTuple!(); + alias follows = MetaList!(); } else static if (!__traits(compiles, mixin("T."~allMembers[i]))) { @@ -4315,7 +4315,7 @@ private template GetOverloadedMethods(T) else enum isMethod = false; } - alias follows = TypeTuple!( + alias follows = MetaList!( Filter!(isMethod, __traits(getOverloads, T, name)), follows!(i + 1)); } @@ -4542,17 +4542,17 @@ package template staticIota(int beg, int end) { static if (beg >= end) { - alias staticIota = TypeTuple!(); + alias staticIota = MetaList!(); } else { - alias staticIota = TypeTuple!(+beg); + alias staticIota = MetaList!(+beg); } } else { enum mid = beg + (end - beg) / 2; - alias staticIota = TypeTuple!(staticIota!(beg, mid), staticIota!(mid, end)); + alias staticIota = MetaList!(staticIota!(beg, mid), staticIota!(mid, end)); } } @@ -5312,7 +5312,7 @@ unittest static immutable arr = [1,2,3]; } - foreach (T; TypeTuple!(MyInt, const MyInt, immutable MyInt)) + foreach (T; MetaList!(MyInt, const MyInt, immutable MyInt)) { T m = 10; static assert(!__traits(compiles, { int x = m; })); @@ -5357,7 +5357,7 @@ unittest this(immutable int[] arr) immutable { value = arr; } } - foreach (T; TypeTuple!(MyArray, const MyArray, immutable MyArray)) + foreach (T; MetaList!(MyArray, const MyArray, immutable MyArray)) { static if (is(T == immutable) && !is(typeof({ T a = [1,2,3,4]; }))) T a = [1,2,3,4].idup; // workaround until qualified ctor is properly supported @@ -6089,7 +6089,7 @@ unittest // Issue 6580 testcase byte[size] arr; alignmentTest(); } - foreach(i; TypeTuple!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) + foreach(i; MetaList!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) test!i(); } } diff --git a/std/typelist.d b/std/typelist.d index 760b63699..2d463082a 100644 --- a/std/typelist.d +++ b/std/typelist.d @@ -27,7 +27,7 @@ * * alias Map!(StripPtr, list) StripPointers; * } - * static assert(is (Synopsis!(char**, void***).StripPointers.toTuple == TypeTuple!(char, void))); + * static assert(is (Synopsis!(char**, void***).StripPointers.toTuple == MetaList!(char, void))); * ---- * * Copyright: Copyright Bartosz Milewski 2008- 2009. @@ -91,10 +91,10 @@ template TypeList(T...) } unittest { - static assert (is (TypeList!(void*, int).toTuple == TypeTuple!(void*, int))); + static assert (is (TypeList!(void*, int).toTuple == MetaList!(void*, int))); static assert (is (TypeList!(void*, int).head == void*)); - static assert (is (TypeList!(void*, int).tail.toTuple == TypeTuple!(int))); - static assert (is (TypeList!(int).tail.toTuple == TypeTuple!())); + static assert (is (TypeList!(void*, int).tail.toTuple == MetaList!(int))); + static assert (is (TypeList!(int).tail.toTuple == MetaList!())); static assert (TypeList!(int).tail.isEmpty); static assert (TypeList!(void*, int).length == 2); @@ -116,9 +116,9 @@ template AppendTypes(alias List, T...) unittest { static assert (is (AppendTypes!(TypeList!(void*, int), long, short).toTuple - == TypeTuple!(void*, int, long, short))); + == MetaList!(void*, int, long, short))); static assert (is (AppendTypes!(TypeList!(void*, int)).toTuple - == TypeTuple!(void*, int))); + == MetaList!(void*, int))); static assert (AppendTypes!(TypeList!()).isEmpty); } @@ -132,9 +132,9 @@ template Append(alias Left, alias Right) unittest { static assert (is (Append!(TypeList!(void*, int), TypeList!(long, short)).toTuple - == TypeTuple!(void*, int, long, short))); + == MetaList!(void*, int, long, short))); static assert (is (Append!(TypeList!(void*, int), TypeList!()).toTuple - == TypeTuple!(void*, int))); + == MetaList!(void*, int))); static assert (Append!(TypeList!(), TypeList!()).isEmpty); } @@ -151,12 +151,12 @@ template Cons(T, alias List) unittest { static assert (is (Cons!(long, TypeList!(void*, int)).toTuple - == TypeTuple!(long, void*, int))); + == MetaList!(long, void*, int))); static assert (is (Cons!(long, TypeList!(void*, int)).head == long)); - static assert (is (Cons!(int, TypeList!()).toTuple == TypeTuple!(int))); + static assert (is (Cons!(int, TypeList!()).toTuple == MetaList!(int))); static assert (is (Cons!(char[], Cons!(int, TypeList!())).toTuple - == TypeTuple!(char[], int))); + == MetaList!(char[], int))); } /** @@ -230,7 +230,7 @@ version(unittest) { unittest { static assert (is (MakePtr!(int) == int*)); - static assert (is (Map!(MakePtr, void *, char) == TypeTuple!(void**, char*))); + static assert (is (Map!(MakePtr, void *, char) == MetaList!(void**, char*))); } /** @@ -257,8 +257,8 @@ template Filter(alias Pred, alias List) } unittest { - static assert(is(Filter!(IsPointer, int, void*, char[], int*) == TypeTuple!(void*, int*))); - static assert(is(Filter!(IsPointer) == TypeTuple!())); + static assert(is(Filter!(IsPointer, int, void*, char[], int*) == MetaList!(void*, int*))); + static assert(is(Filter!(IsPointer) == MetaList!())); } template FoldRight(alias F, alias Init, alias List) @@ -291,8 +291,8 @@ version(unittest) { unittest { // *** Compiler bugs - //static assert (snoC!(int, TypeList!(long)).toTuple == TypeTuple!(long, int)); - //static assert (FoldRight!(snoC, TypeList!(), TypeList!(int, long)).toTuple == TypeTuple!(long, int)); + //static assert (snoC!(int, TypeList!(long)).toTuple == MetaList!(long, int)); + //static assert (FoldRight!(snoC, TypeList!(), TypeList!(int, long)).toTuple == MetaList!(long, int)); static assert (!FoldRight!(snoC, TypeList!(), TypeList!(int)).isEmpty); static assert (FoldRight!(Inc, 0, TypeList!(int, long)) == 2); } diff --git a/std/uni.d b/std/uni.d index 4f69c48d7..41a2a06c7 100644 --- a/std/uni.d +++ b/std/uni.d @@ -796,7 +796,7 @@ size_t replicateBits(size_t times, size_t bits)(size_t val) @safe pure nothrow @ import std.range : iota; size_t m = 0b111; size_t m2 = 0b01; - foreach(i; TypeTuple!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) + foreach(i; MetaList!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) { assert(replicateBits!(i, 3)(m)+1 == (1<<(3*i))); assert(replicateBits!(i, 2)(m2) == iota(0, i).map!"2^^(2*a)"().sum()); @@ -3369,7 +3369,7 @@ private: assert(u24 != u24_2); } - foreach(Policy; TypeTuple!(GcPolicy, ReallocPolicy)) + foreach(Policy; MetaList!(GcPolicy, ReallocPolicy)) { alias Range = typeof(CowArray!Policy.init[]); alias U24A = CowArray!Policy; @@ -3407,7 +3407,7 @@ private: version(unittest) { - private alias AllSets = TypeTuple!(InversionList!GcPolicy, InversionList!ReallocPolicy); + private alias AllSets = MetaList!(InversionList!GcPolicy, InversionList!ReallocPolicy); } @safe unittest// core set primitives test @@ -3646,7 +3646,7 @@ version(unittest) { import std.conv; import std.typecons; - foreach(CodeList; TypeTuple!(InversionList!(ReallocPolicy))) + foreach(CodeList; MetaList!(InversionList!(ReallocPolicy))) { auto arr = "ABCDEFGHIJKLMabcdefghijklm"d; auto a = CodeList('A','N','a', 'n'); @@ -4108,10 +4108,10 @@ template GetBitSlicing(size_t top, sizes...) { static if(sizes.length > 0) alias GetBitSlicing = - TypeTuple!(sliceBits!(top - sizes[0], top), + MetaList!(sliceBits!(top - sizes[0], top), GetBitSlicing!(top - sizes[0], sizes[1..$])); else - alias GetBitSlicing = TypeTuple!(); + alias GetBitSlicing = MetaList!(); } template callableWith(T) @@ -4397,9 +4397,9 @@ public template buildTrie(Value, Key, Args...) { static if(n > 0) alias GetComparators = - TypeTuple!(GetComparators!(n-1), cmpK0!(Prefix[n-1])); + MetaList!(GetComparators!(n-1), cmpK0!(Prefix[n-1])); else - alias GetComparators = TypeTuple!(); + alias GetComparators = MetaList!(); } /* @@ -4674,22 +4674,22 @@ template Utf8Matcher() } //for 1-stage ASCII - alias AsciiSpec = TypeTuple!(bool, char, clamp!7); + alias AsciiSpec = MetaList!(bool, char, clamp!7); //for 2-stage lookup of 2 byte UTF-8 sequences - alias Utf8Spec2 = TypeTuple!(bool, char[2], + alias Utf8Spec2 = MetaList!(bool, char[2], clampIdx!(0, 5), clampIdx!(1, 6)); //ditto for 3 byte - alias Utf8Spec3 = TypeTuple!(bool, char[3], + alias Utf8Spec3 = MetaList!(bool, char[3], clampIdx!(0, 4), clampIdx!(1, 6), clampIdx!(2, 6) ); //ditto for 4 byte - alias Utf8Spec4 = TypeTuple!(bool, char[4], + alias Utf8Spec4 = MetaList!(bool, char[4], clampIdx!(0, 3), clampIdx!(1, 6), clampIdx!(2, 6), clampIdx!(3, 6) ); - alias Tables = TypeTuple!( + alias Tables = MetaList!( typeof(TrieBuilder!(AsciiSpec)(false).build()), typeof(TrieBuilder!(Utf8Spec2)(false).build()), typeof(TrieBuilder!(Utf8Spec3)(false).build()), @@ -4953,7 +4953,7 @@ template Utf16Matcher() throw new UTFException("Invalid UTF-16 sequence"); } - alias Seq = TypeTuple; + alias Seq = MetaList; // 1-stage ASCII alias AsciiSpec = Seq!(bool, wchar, clamp!7); //2-stage BMP @@ -5388,7 +5388,7 @@ unittest auto utf16 = utfMatcher!wchar(unicode.L); auto utf8 = utfMatcher!char(unicode.L); //decode failure cases UTF-8 - alias fails8 = TypeTuple!("\xC1", "\x80\x00","\xC0\x00", "\xCF\x79", + alias fails8 = MetaList!("\xC1", "\x80\x00","\xC0\x00", "\xCF\x79", "\xFF\x00\0x00\0x00\x00", "\xC0\0x80\0x80\x80", "\x80\0x00\0x00\x00", "\xCF\x00\0x00\0x00\x00"); foreach(msg; fails8){ @@ -5401,7 +5401,7 @@ unittest }()), format("%( %2x %)", cast(ubyte[])msg)); } //decode failure cases UTF-16 - alias fails16 = TypeTuple!([0xD811], [0xDC02]); + alias fails16 = MetaList!([0xD811], [0xDC02]); foreach(msg; fails16){ assert(collectException((){ auto s = msg.map!(x => cast(wchar)x); @@ -5583,9 +5583,9 @@ static assert(bitSizeOf!(BitPacked!(uint, 2)) == 2); template Sequence(size_t start, size_t end) { static if(start < end) - alias Sequence = TypeTuple!(start, Sequence!(start+1, end)); + alias Sequence = MetaList!(start, Sequence!(start+1, end)); else - alias Sequence = TypeTuple!(); + alias Sequence = MetaList!(); } //---- TRIE TESTS ---- @@ -5715,7 +5715,7 @@ template idxTypes(Key, size_t fullBits, Prefix...) { static if(Prefix.length == 1) {// the last level is value level, so no index once reduced to 1-level - alias idxTypes = TypeTuple!(); + alias idxTypes = MetaList!(); } else { @@ -5725,7 +5725,7 @@ template idxTypes(Key, size_t fullBits, Prefix...) // thus it's size in pages is full_bit_width - size_of_last_prefix // Recourse on this notion alias idxTypes = - TypeTuple!( + MetaList!( idxTypes!(Key, fullBits - bitSizeOf!(Prefix[$-1]), Prefix[0..$-1]), BitPacked!(typeof(Prefix[$-2](Key.init)), fullBits - bitSizeOf!(Prefix[$-1])) ); @@ -6590,7 +6590,7 @@ unittest auto gReverse = reverse.byGrapheme; assert(gReverse.walkLength == 4); - foreach(text; TypeTuple!("noe\u0308l"c, "noe\u0308l"w, "noe\u0308l"d)) + foreach(text; MetaList!("noe\u0308l"c, "noe\u0308l"w, "noe\u0308l"d)) { assert(text.walkLength == 5); static assert(isForwardRange!(typeof(text))); @@ -7237,10 +7237,10 @@ unittest import std.algorithm; assertCTFEable!( { - foreach(cfunc; TypeTuple!(icmp, sicmp)) + foreach(cfunc; MetaList!(icmp, sicmp)) { - foreach(S1; TypeTuple!(string, wstring, dstring)) - foreach(S2; TypeTuple!(string, wstring, dstring)) + foreach(S1; MetaList!(string, wstring, dstring)) + foreach(S2; MetaList!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(cfunc("".to!S1(), "".to!S2()) == 0); assert(cfunc("A".to!S1(), "".to!S2()) > 0); @@ -8167,8 +8167,8 @@ private dchar toTitlecase(dchar c) return c; } -private alias UpperTriple = TypeTuple!(toUpperIndex, MAX_SIMPLE_UPPER, toUpperTab); -private alias LowerTriple = TypeTuple!(toLowerIndex, MAX_SIMPLE_LOWER, toLowerTab); +private alias UpperTriple = MetaList!(toUpperIndex, MAX_SIMPLE_UPPER, toUpperTab); +private alias LowerTriple = MetaList!(toLowerIndex, MAX_SIMPLE_LOWER, toLowerTab); // generic toUpper/toLower on whole string, creates new or returns as is private S toCase(alias indexFn, uint maxIdx, alias tableFn, S)(S s) @trusted pure @@ -9100,7 +9100,7 @@ unittest assert(upInp == trueUp, format(diff, cast(ubyte[])s, cast(ubyte[])upInp, cast(ubyte[])trueUp)); } - foreach(S; TypeTuple!(dstring, wstring, string)) + foreach(S; MetaList!(dstring, wstring, string)) { S easy = "123"; @@ -9111,7 +9111,7 @@ unittest S[] lower = ["123", "abcфеж", "\u0131\u023f\u03c9", "i\u0307\u1Fe2"]; S[] upper = ["123", "ABCФЕЖ", "I\u2c7e\u2126", "\u0130\u03A5\u0308\u0300"]; - foreach(val; TypeTuple!(easy, good)) + foreach(val; MetaList!(easy, good)) { auto e = val.dup; auto g = e; diff --git a/std/uri.d b/std/uri.d index 051eda43d..830763d52 100644 --- a/std/uri.d +++ b/std/uri.d @@ -545,8 +545,8 @@ unittest result = decode("%41%42%43"); debug(uri) writeln(result); - import std.meta : TypeTuple; - foreach (StringType; TypeTuple!(char[], wchar[], dchar[], string, wstring, dstring)) + import std.meta : MetaList; + foreach (StringType; MetaList!(char[], wchar[], dchar[], string, wstring, dstring)) { import std.conv : to; StringType decoded1 = source.to!StringType; diff --git a/std/utf.d b/std/utf.d index 3c6c13fe9..b88136654 100644 --- a/std/utf.d +++ b/std/utf.d @@ -22,7 +22,7 @@ module std.utf; import std.range.primitives; import std.traits; // isSomeChar, isSomeString -import std.meta; // TypeTuple +import std.meta; // MetaList //debug=utf; // uncomment to turn on debugging printf's @@ -248,7 +248,7 @@ unittest test("hello\U00010143\u0100\U00010143", '\u0100', 9); test("hello\U00010143\u0100\U00010143", '\U00010143', 11); - foreach (S; TypeTuple!(char[], const char[], string)) + foreach (S; MetaList!(char[], const char[], string)) { enum str = to!S("hello world"); static assert(isSafe!({ stride(str, 0); })); @@ -309,7 +309,7 @@ uint strideBack(S)(auto ref S str, size_t index) if (index >= 4) //single verification for most common case { - foreach (i; TypeTuple!(2, 3, 4)) + foreach (i; MetaList!(2, 3, 4)) { if ((str[index-i] & 0b1100_0000) != 0b1000_0000) return i; @@ -317,7 +317,7 @@ uint strideBack(S)(auto ref S str, size_t index) } else { - foreach (i; TypeTuple!(2, 3)) + foreach (i; MetaList!(2, 3)) { if (index >= i && (str[index-i] & 0b1100_0000) != 0b1000_0000) return i; @@ -339,7 +339,7 @@ uint strideBack(S)(auto ref S str) { assert(!str.empty, "Past the end of the UTF-8 sequence"); auto temp = str.save; - foreach (i; TypeTuple!(1, 2, 3, 4)) + foreach (i; MetaList!(1, 2, 3, 4)) { if ((temp.back & 0b1100_0000) != 0b1000_0000) return i; @@ -406,7 +406,7 @@ unittest test("\U00010143\u0100\U00010143hello", '\u0100', 6); test("\U00010143\u0100\U00010143hello", '\U00010143', 4); - foreach (S; TypeTuple!(char[], const char[], string)) + foreach (S; MetaList!(char[], const char[], string)) { enum str = to!S("hello world"); static assert(isSafe!({ strideBack(str, 0); })); @@ -522,7 +522,7 @@ uint stride(S)(auto ref S str) test("hello\U00010143\u0100\U00010143", '\u0100', 7); test("hello\U00010143\u0100\U00010143", '\U00010143', 8); - foreach (S; TypeTuple!(wchar[], const wchar[], wstring)) + foreach (S; MetaList!(wchar[], const wchar[], wstring)) { enum str = to!S("hello world"); static assert(isSafe!(() => stride(str, 0))); @@ -642,7 +642,7 @@ unittest test("\U00010143\u0100\U00010143hello", '\u0100', 3); test("\U00010143\u0100\U00010143hello", '\U00010143', 2); - foreach (S; TypeTuple!(wchar[], const wchar[], wstring)) + foreach (S; MetaList!(wchar[], const wchar[], wstring)) { enum str = to!S("hello world"); static assert(isSafe!(() => strideBack(str, 0))); @@ -733,7 +733,7 @@ unittest test("hello\U00010143\u0100\U00010143", '\u0100', 6); test("hello\U00010143\u0100\U00010143", '\U00010143', 7); - foreach (S; TypeTuple!(dchar[], const dchar[], dstring)) + foreach (S; MetaList!(dchar[], const dchar[], dstring)) { enum str = to!S("hello world"); static assert(isSafe!(() => stride(str, 0))); @@ -834,7 +834,7 @@ unittest test("\U00010143\u0100\U00010143hello", '\u0100', 2); test("\U00010143\u0100\U00010143hello", '\U00010143', 1); - foreach (S; TypeTuple!(dchar[], const dchar[], dstring)) + foreach (S; MetaList!(dchar[], const dchar[], dstring)) { enum str = to!S("hello world"); static assert(isSafe!(() => strideBack(str, 0))); @@ -1107,7 +1107,7 @@ private dchar decodeImpl(bool canIndex, S)(auto ref S str, ref size_t index) /* Dchar bitmask for different numbers of UTF-8 code units. */ - alias bitMask = TypeTuple!((1 << 7) - 1, (1 << 11) - 1, (1 << 16) - 1, (1 << 21) - 1); + alias bitMask = MetaList!((1 << 7) - 1, (1 << 11) - 1, (1 << 16) - 1, (1 << 21) - 1); static if (is(S : const char[])) auto pstr = str.ptr + index; @@ -1176,7 +1176,7 @@ private dchar decodeImpl(bool canIndex, S)(auto ref S str, ref size_t index) dchar d = fst; // upper control bits are masked out later fst <<= 1; - foreach (i; TypeTuple!(1, 2, 3)) + foreach (i; MetaList!(1, 2, 3)) { static if (canIndex) @@ -1425,7 +1425,7 @@ unittest assertCTFEable!( { - foreach (S; TypeTuple!(to!string, InputCU!char, RandomCU!char, + foreach (S; MetaList!(to!string, InputCU!char, RandomCU!char, (string s) => new RefBidirCU!char(s), (string s) => new RefRandomCU!char(s))) { @@ -1487,7 +1487,7 @@ unittest import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(to!wstring, InputCU!wchar, RandomCU!wchar, + foreach (S; MetaList!(to!wstring, InputCU!wchar, RandomCU!wchar, (wstring s) => new RefBidirCU!wchar(s), (wstring s) => new RefRandomCU!wchar(s))) { @@ -1511,7 +1511,7 @@ unittest } } - foreach (S; TypeTuple!(to!wstring, RandomCU!wchar, (wstring s) => new RefRandomCU!wchar(s))) + foreach (S; MetaList!(to!wstring, RandomCU!wchar, (wstring s) => new RefRandomCU!wchar(s))) { auto str = S([cast(wchar)0xD800, cast(wchar)0xDC00, cast(wchar)0x1400, @@ -1529,7 +1529,7 @@ unittest import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!(to!dstring, RandomCU!dchar, InputCU!dchar, + foreach (S; MetaList!(to!dstring, RandomCU!dchar, InputCU!dchar, (dstring s) => new RefBidirCU!dchar(s), (dstring s) => new RefRandomCU!dchar(s))) { @@ -1554,7 +1554,7 @@ unittest } } - foreach (S; TypeTuple!(to!dstring, RandomCU!dchar, (dstring s) => new RefRandomCU!dchar(s))) + foreach (S; MetaList!(to!dstring, RandomCU!dchar, (dstring s) => new RefRandomCU!dchar(s))) { auto str = S([cast(dchar)0x10000, cast(dchar)0x1400, cast(dchar)0xB9DDE]); testDecode(str, 0, 0x10000, 1); @@ -1569,7 +1569,7 @@ unittest import std.exception; assertCTFEable!( { - foreach (S; TypeTuple!( char[], const( char)[], string, + foreach (S; MetaList!( char[], const( char)[], string, wchar[], const(wchar)[], wstring, dchar[], const(dchar)[], dstring)) { @@ -2009,11 +2009,11 @@ unittest assertCTFEable!( { - foreach (S; TypeTuple!( char[], const char[], string, + foreach (S; MetaList!( char[], const char[], string, wchar[], const wchar[], wstring, dchar[], const dchar[], dstring)) { - foreach (C; TypeTuple!(char, wchar, dchar)) + foreach (C; MetaList!(char, wchar, dchar)) { assert(codeLength!C(to!S("Walter Bright")) == to!(C[])("Walter Bright").length); assert(codeLength!C(to!S(`言語`)) == to!(C[])(`言語`).length); @@ -2498,7 +2498,7 @@ private P toUTFzImpl(P, S)(S str) @safe pure assertCTFEable!( { - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) { alias C = Unqual!(ElementEncodingType!S); @@ -2518,7 +2518,7 @@ private P toUTFzImpl(P, S)(S str) @safe pure assert(p[s.length] == '\0'); } - foreach (P; TypeTuple!(C*, const(C)*, immutable(C)*)) + foreach (P; MetaList!(C*, const(C)*, immutable(C)*)) { trustedCStringAssert!P(s1); trustedCStringAssert!P(s2); @@ -2544,28 +2544,28 @@ private P toUTFzImpl(P, S)(S str) @safe pure assertCTFEable!( { - foreach (P; TypeTuple!(wchar*, const(wchar)*, immutable(wchar)*, + foreach (P; MetaList!(wchar*, const(wchar)*, immutable(wchar)*, dchar*, const(dchar)*, immutable(dchar)*)) { test!P("hello\U00010143\u0100\U00010143"); } - foreach (P; TypeTuple!( char*, const( char)*, immutable( char)*, + foreach (P; MetaList!( char*, const( char)*, immutable( char)*, dchar*, const(dchar)*, immutable(dchar)*)) { test!P("hello\U00010143\u0100\U00010143"w); } - foreach (P; TypeTuple!( char*, const( char)*, immutable( char)*, + foreach (P; MetaList!( char*, const( char)*, immutable( char)*, wchar*, const(wchar)*, immutable(wchar)*)) { test!P("hello\U00010143\u0100\U00010143"d); } - foreach (S; TypeTuple!( char[], const( char)[], + foreach (S; MetaList!( char[], const( char)[], wchar[], const(wchar)[], dchar[], const(dchar)[])) { auto s = to!S("hello\U00010143\u0100\U00010143"); - foreach (P; TypeTuple!( char*, const( char)*, immutable( char)*, + foreach (P; MetaList!( char*, const( char)*, immutable( char)*, wchar*, const(wchar)*, immutable(wchar)*, dchar*, const(dchar)*, immutable(dchar)*)) { @@ -2594,7 +2594,7 @@ const(wchar)* toUTF16z(C)(const(C)[] str) @safe pure import std.conv : to; //toUTFz is already thoroughly tested, so this will just verify that //toUTF16z compiles properly for the various string types. - foreach (S; TypeTuple!(string, wstring, dstring)) + foreach (S; MetaList!(string, wstring, dstring)) static assert(__traits(compiles, toUTF16z(to!S("hello world")))); } @@ -3297,9 +3297,9 @@ auto ref byDchar(R)(R r) /* Dchar bitmask for different numbers of UTF-8 code units. */ - alias bitMask = TypeTuple!((1 << 7) - 1, (1 << 11) - 1, (1 << 16) - 1, (1 << 21) - 1); + alias bitMask = MetaList!((1 << 7) - 1, (1 << 11) - 1, (1 << 16) - 1, (1 << 21) - 1); - foreach (i; TypeTuple!(1, 2, 3)) + foreach (i; MetaList!(1, 2, 3)) { r.popFront(); @@ -3629,7 +3629,7 @@ int impureVariable; } } - foreach (Char; TypeTuple!(char, wchar, dchar)) + foreach (Char; MetaList!(char, wchar, dchar)) { ImpureThrowingSystemRange!Char range; foreach (c; range.byChar()) { } diff --git a/std/uuid.d b/std/uuid.d index 16faf5932..ad7cf701f 100644 --- a/std/uuid.d +++ b/std/uuid.d @@ -421,7 +421,7 @@ public struct UUID import std.meta; import std.conv : to; - foreach(S; TypeTuple!(char[], const(char)[], immutable(char)[], + foreach(S; MetaList!(char[], const(char)[], immutable(char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[], immutable(char[]), immutable(wchar[]), immutable(dchar[]))) @@ -1406,7 +1406,7 @@ unittest return parseUUID(to!T(input)); } - foreach(S; TypeTuple!(char[], const(char)[], immutable(char)[], + foreach(S; MetaList!(char[], const(char)[], immutable(char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[], immutable(char[]), immutable(wchar[]), immutable(dchar[]), diff --git a/std/variant.d b/std/variant.d index 852b1baa0..6e2438f1d 100644 --- a/std/variant.d +++ b/std/variant.d @@ -103,28 +103,28 @@ template AssociativeArray(T : V[K], K, V) template This2Variant(V, T...) { static if (T.length == 0) - alias This2Variant = TypeTuple!(); + alias This2Variant = MetaList!(); else static if (is(AssociativeArray!(T[0]).Key == This)) { static if (is(AssociativeArray!(T[0]).Value == This)) alias This2Variant = - TypeTuple!(V[V], + MetaList!(V[V], This2Variant!(V, T[1 .. $])); else alias This2Variant = - TypeTuple!(AssociativeArray!(T[0]).Value[V], + MetaList!(AssociativeArray!(T[0]).Value[V], This2Variant!(V, T[1 .. $])); } else static if (is(AssociativeArray!(T[0]).Value == This)) alias This2Variant = - TypeTuple!(V[AssociativeArray!(T[0]).Key], + MetaList!(V[AssociativeArray!(T[0]).Key], This2Variant!(V, T[1 .. $])); else static if (is(T[0] == This[])) - alias This2Variant = TypeTuple!(V[], This2Variant!(V, T[1 .. $])); + alias This2Variant = MetaList!(V[], This2Variant!(V, T[1 .. $])); else static if (is(T[0] == This*)) - alias This2Variant = TypeTuple!(V*, This2Variant!(V, T[1 .. $])); + alias This2Variant = MetaList!(V*, This2Variant!(V, T[1 .. $])); else - alias This2Variant = TypeTuple!(T[0], This2Variant!(V, T[1 .. $])); + alias This2Variant = MetaList!(T[0], This2Variant!(V, T[1 .. $])); } /** @@ -294,27 +294,27 @@ private: static bool tryPutting(A* src, TypeInfo targetType, void* target) { alias UA = Unqual!A; - alias MutaTypes = TypeTuple!(UA, ImplicitConversionTargets!UA); + alias MutaTypes = MetaList!(UA, ImplicitConversionTargets!UA); alias ConstTypes = staticMap!(ConstOf, MutaTypes); alias SharedTypes = staticMap!(SharedOf, MutaTypes); alias SharedConstTypes = staticMap!(SharedConstOf, MutaTypes); alias ImmuTypes = staticMap!(ImmutableOf, MutaTypes); static if (is(A == immutable)) - alias AllTypes = TypeTuple!(ImmuTypes, ConstTypes, SharedConstTypes); + alias AllTypes = MetaList!(ImmuTypes, ConstTypes, SharedConstTypes); else static if (is(A == shared)) { static if (is(A == const)) alias AllTypes = SharedConstTypes; else - alias AllTypes = TypeTuple!(SharedTypes, SharedConstTypes); + alias AllTypes = MetaList!(SharedTypes, SharedConstTypes); } else { static if (is(A == const)) alias AllTypes = ConstTypes; else - alias AllTypes = TypeTuple!(MutaTypes, ConstTypes); + alias AllTypes = MetaList!(MutaTypes, ConstTypes); } foreach (T ; AllTypes) @@ -1266,7 +1266,7 @@ unittest } static assert(S.sizeof >= Variant.sizeof); - alias Types = TypeTuple!(string, int, S); + alias Types = MetaList!(string, int, S); alias MyVariant = VariantN!(maxSize!Types, Types); auto v = MyVariant(S.init); @@ -1485,7 +1485,7 @@ static class VariantException : Exception unittest { alias W1 = This2Variant!(char, int, This[int]); - alias W2 = TypeTuple!(int, char[int]); + alias W2 = MetaList!(int, char[int]); static assert(is(W1 == W2)); alias var_t = Algebraic!(void, string); @@ -2315,24 +2315,24 @@ unittest int i = 10; v = i; - foreach (qual; TypeTuple!(MutableOf, ConstOf)) + foreach (qual; MetaList!(MutableOf, ConstOf)) { assert(v.get!(qual!int) == 10); assert(v.get!(qual!float) == 10.0f); } - foreach (qual; TypeTuple!(ImmutableOf, SharedOf, SharedConstOf)) + foreach (qual; MetaList!(ImmutableOf, SharedOf, SharedConstOf)) { assertThrown!VariantException(v.get!(qual!int)); } const(int) ci = 20; v = ci; - foreach (qual; TypeTuple!(ConstOf)) + foreach (qual; MetaList!(ConstOf)) { assert(v.get!(qual!int) == 20); assert(v.get!(qual!float) == 20.0f); } - foreach (qual; TypeTuple!(MutableOf, ImmutableOf, SharedOf, SharedConstOf)) + foreach (qual; MetaList!(MutableOf, ImmutableOf, SharedOf, SharedConstOf)) { assertThrown!VariantException(v.get!(qual!int)); assertThrown!VariantException(v.get!(qual!float)); @@ -2340,12 +2340,12 @@ unittest immutable(int) ii = ci; v = ii; - foreach (qual; TypeTuple!(ImmutableOf, ConstOf, SharedConstOf)) + foreach (qual; MetaList!(ImmutableOf, ConstOf, SharedConstOf)) { assert(v.get!(qual!int) == 20); assert(v.get!(qual!float) == 20.0f); } - foreach (qual; TypeTuple!(MutableOf, SharedOf)) + foreach (qual; MetaList!(MutableOf, SharedOf)) { assertThrown!VariantException(v.get!(qual!int)); assertThrown!VariantException(v.get!(qual!float)); @@ -2353,12 +2353,12 @@ unittest int[] ai = [1,2,3]; v = ai; - foreach (qual; TypeTuple!(MutableOf, ConstOf)) + foreach (qual; MetaList!(MutableOf, ConstOf)) { assert(v.get!(qual!(int[])) == [1,2,3]); assert(v.get!(qual!(int)[]) == [1,2,3]); } - foreach (qual; TypeTuple!(ImmutableOf, SharedOf, SharedConstOf)) + foreach (qual; MetaList!(ImmutableOf, SharedOf, SharedConstOf)) { assertThrown!VariantException(v.get!(qual!(int[]))); assertThrown!VariantException(v.get!(qual!(int)[])); @@ -2366,12 +2366,12 @@ unittest const(int[]) cai = [4,5,6]; v = cai; - foreach (qual; TypeTuple!(ConstOf)) + foreach (qual; MetaList!(ConstOf)) { assert(v.get!(qual!(int[])) == [4,5,6]); assert(v.get!(qual!(int)[]) == [4,5,6]); } - foreach (qual; TypeTuple!(MutableOf, ImmutableOf, SharedOf, SharedConstOf)) + foreach (qual; MetaList!(MutableOf, ImmutableOf, SharedOf, SharedConstOf)) { assertThrown!VariantException(v.get!(qual!(int[]))); assertThrown!VariantException(v.get!(qual!(int)[])); @@ -2385,7 +2385,7 @@ unittest assert(v.get!(const(int)[]) == [7,8,9]); //assert(v.get!(shared(const(int[]))) == cast(shared const)[7,8,9]); // Bug ??? runtime error //assert(v.get!(shared(const(int))[]) == cast(shared const)[7,8,9]); // Bug ??? runtime error - foreach (qual; TypeTuple!(MutableOf)) + foreach (qual; MetaList!(MutableOf)) { assertThrown!VariantException(v.get!(qual!(int[]))); assertThrown!VariantException(v.get!(qual!(int)[])); @@ -2395,13 +2395,13 @@ unittest class B : A {} B b = new B(); v = b; - foreach (qual; TypeTuple!(MutableOf, ConstOf)) + foreach (qual; MetaList!(MutableOf, ConstOf)) { assert(v.get!(qual!B) is b); assert(v.get!(qual!A) is b); assert(v.get!(qual!Object) is b); } - foreach (qual; TypeTuple!(ImmutableOf, SharedOf, SharedConstOf)) + foreach (qual; MetaList!(ImmutableOf, SharedOf, SharedConstOf)) { assertThrown!VariantException(v.get!(qual!B)); assertThrown!VariantException(v.get!(qual!A)); @@ -2410,13 +2410,13 @@ unittest const(B) cb = new B(); v = cb; - foreach (qual; TypeTuple!(ConstOf)) + foreach (qual; MetaList!(ConstOf)) { assert(v.get!(qual!B) is cb); assert(v.get!(qual!A) is cb); assert(v.get!(qual!Object) is cb); } - foreach (qual; TypeTuple!(MutableOf, ImmutableOf, SharedOf, SharedConstOf)) + foreach (qual; MetaList!(MutableOf, ImmutableOf, SharedOf, SharedConstOf)) { assertThrown!VariantException(v.get!(qual!B)); assertThrown!VariantException(v.get!(qual!A)); @@ -2425,13 +2425,13 @@ unittest immutable(B) ib = new immutable(B)(); v = ib; - foreach (qual; TypeTuple!(ImmutableOf, ConstOf, SharedConstOf)) + foreach (qual; MetaList!(ImmutableOf, ConstOf, SharedConstOf)) { assert(v.get!(qual!B) is ib); assert(v.get!(qual!A) is ib); assert(v.get!(qual!Object) is ib); } - foreach (qual; TypeTuple!(MutableOf, SharedOf)) + foreach (qual; MetaList!(MutableOf, SharedOf)) { assertThrown!VariantException(v.get!(qual!B)); assertThrown!VariantException(v.get!(qual!A)); @@ -2440,13 +2440,13 @@ unittest shared(B) sb = new shared B(); v = sb; - foreach (qual; TypeTuple!(SharedOf, SharedConstOf)) + foreach (qual; MetaList!(SharedOf, SharedConstOf)) { assert(v.get!(qual!B) is sb); assert(v.get!(qual!A) is sb); assert(v.get!(qual!Object) is sb); } - foreach (qual; TypeTuple!(MutableOf, ImmutableOf, ConstOf)) + foreach (qual; MetaList!(MutableOf, ImmutableOf, ConstOf)) { assertThrown!VariantException(v.get!(qual!B)); assertThrown!VariantException(v.get!(qual!A)); @@ -2455,13 +2455,13 @@ unittest shared(const(B)) scb = new shared const B(); v = scb; - foreach (qual; TypeTuple!(SharedConstOf)) + foreach (qual; MetaList!(SharedConstOf)) { assert(v.get!(qual!B) is scb); assert(v.get!(qual!A) is scb); assert(v.get!(qual!Object) is scb); } - foreach (qual; TypeTuple!(MutableOf, ConstOf, ImmutableOf, SharedOf)) + foreach (qual; MetaList!(MutableOf, ConstOf, ImmutableOf, SharedOf)) { assertThrown!VariantException(v.get!(qual!B)); assertThrown!VariantException(v.get!(qual!A));