94 changes: 47 additions & 47 deletions std/meta.d
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ template AliasSeq(TList...)
}

///
unittest
@safe unittest
{
import std.meta;
alias TL = AliasSeq!(int, double);
Expand All @@ -92,7 +92,7 @@ unittest
}

///
unittest
@safe unittest
{
alias TL = AliasSeq!(int, double);

Expand Down Expand Up @@ -121,7 +121,7 @@ alias Alias(alias a) = a;
alias Alias(T) = T;

///
unittest
@safe unittest
{
// Without Alias this would fail if Args[0] was e.g. a value and
// some logic would be needed to detect when to use enum instead
Expand All @@ -135,7 +135,7 @@ unittest
}

///
unittest
@safe unittest
{
alias a = Alias!(123);
static assert(a == 123);
Expand Down Expand Up @@ -187,7 +187,7 @@ package template OldAlias(T) if (isAggregateType!T && !is(Unqual!T == T))
alias OldAlias = Unqual!T;
}

unittest
@safe unittest
{
static struct Foo {}
static assert(is(OldAlias!(const(Foo)) == Foo));
Expand All @@ -214,7 +214,7 @@ template staticIndexOf(alias T, TList...)
}

///
unittest
@safe unittest
{
import std.stdio;

Expand Down Expand Up @@ -254,7 +254,7 @@ private template genericIndexOf(args...)
}
}

unittest
@safe unittest
{
static assert(staticIndexOf!( byte, byte, short, int, long) == 0);
static assert(staticIndexOf!(short, byte, short, int, long) == 1);
Expand Down Expand Up @@ -296,7 +296,7 @@ template Erase(alias T, TList...)
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(int, long, double, char);
alias TL = Erase!(long, Types);
Expand Down Expand Up @@ -326,7 +326,7 @@ private template GenericErase(args...)
}
}

unittest
@safe unittest
{
static assert(Pack!(Erase!(int,
short, int, int, 4)).
Expand Down Expand Up @@ -354,7 +354,7 @@ template EraseAll(alias T, TList...)
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(int, long, long, int);

Expand Down Expand Up @@ -389,7 +389,7 @@ private template GenericEraseAll(args...)
}
}

unittest
@safe unittest
{
static assert(Pack!(EraseAll!(int,
short, int, int, 4)).
Expand Down Expand Up @@ -436,7 +436,7 @@ template NoDuplicates(TList...)
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(int, long, long, int, float);

Expand All @@ -448,7 +448,7 @@ unittest
static assert(NoDuplicates!LongList.length == 1);
}

unittest
@safe unittest
{
static assert(
Pack!(
Expand Down Expand Up @@ -485,7 +485,7 @@ template Replace(alias T, alias U, TList...)
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(int, long, long, int, float);

Expand Down Expand Up @@ -518,7 +518,7 @@ private template GenericReplace(args...)
}
}

unittest
@safe unittest
{
static assert(Pack!(Replace!(byte, ubyte,
short, byte, byte, byte)).
Expand Down Expand Up @@ -565,7 +565,7 @@ template ReplaceAll(alias T, alias U, TList...)
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(int, long, long, int, float);

Expand Down Expand Up @@ -598,7 +598,7 @@ private template GenericReplaceAll(args...)
}
}

unittest
@safe unittest
{
static assert(Pack!(ReplaceAll!(byte, ubyte,
byte, short, byte, byte)).
Expand Down Expand Up @@ -636,7 +636,7 @@ template Reverse(TList...)
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(int, long, long, int, float);

Expand All @@ -659,7 +659,7 @@ template MostDerived(T, TList...)
}

///
unittest
@safe unittest
{
class A { }
class B : A { }
Expand Down Expand Up @@ -687,7 +687,7 @@ template DerivedToFront(TList...)
}

///
unittest
@safe unittest
{
class A { }
class B : A { }
Expand Down Expand Up @@ -721,14 +721,14 @@ template staticMap(alias F, T...)
}

///
unittest
@safe unittest
{
import std.traits : Unqual;
alias TL = staticMap!(Unqual, int, const int, immutable int);
static assert(is(TL == AliasSeq!(int, int, int)));
}

unittest
@safe unittest
{
import std.traits : Unqual;

Expand Down Expand Up @@ -770,7 +770,7 @@ template allSatisfy(alias F, T...)
}

///
unittest
@safe unittest
{
import std.traits : isIntegral;

Expand Down Expand Up @@ -804,7 +804,7 @@ template anySatisfy(alias F, T...)
}

///
unittest
@safe unittest
{
import std.traits : isIntegral;

Expand Down Expand Up @@ -840,7 +840,7 @@ template Filter(alias pred, TList...)
}

///
unittest
@safe unittest
{
import std.traits : isNarrowString, isUnsigned;

Expand All @@ -853,7 +853,7 @@ unittest
static assert(is(TL2 == AliasSeq!(ubyte, uint, ulong)));
}

unittest
@safe unittest
{
import std.traits : isPointer;

Expand Down Expand Up @@ -891,7 +891,7 @@ template templateNot(alias pred)
}

///
unittest
@safe unittest
{
import std.traits : isPointer;

Expand All @@ -900,7 +900,7 @@ unittest
static assert(allSatisfy!(isNoPointer, string, char, float));
}

unittest
@safe unittest
{
foreach (T; AliasSeq!(int, staticMap, 42))
{
Expand Down Expand Up @@ -938,7 +938,7 @@ template templateAnd(Preds...)
}

///
unittest
@safe unittest
{
import std.traits : isNumeric, isUnsigned;

Expand All @@ -951,7 +951,7 @@ unittest
static assert(alwaysTrue!int);
}

unittest
@safe unittest
{
foreach (T; AliasSeq!(int, staticMap, 42))
{
Expand Down Expand Up @@ -996,7 +996,7 @@ template templateOr(Preds...)
}

///
unittest
@safe unittest
{
import std.traits : isPointer, isUnsigned;

Expand All @@ -1009,7 +1009,7 @@ unittest
static assert(!alwaysFalse!int);
}

unittest
@safe unittest
{
foreach (T; AliasSeq!(int, staticMap, 42))
{
Expand Down Expand Up @@ -1068,7 +1068,7 @@ template aliasSeqOf(alias range)
}

///
unittest
@safe unittest
{
import std.algorithm : map, sort;
import std.string : capitalize;
Expand All @@ -1087,7 +1087,7 @@ unittest
}

///
unittest
@safe unittest
{
static immutable REF = [0, 1, 2, 3];
foreach (I, V; aliasSeqOf!([0, 1, 2, 3]))
Expand All @@ -1097,7 +1097,7 @@ unittest
}
}

unittest
@safe unittest
{
import std.range : iota;
import std.conv : to, octal;
Expand All @@ -1113,7 +1113,7 @@ unittest
}
}

unittest
@safe unittest
{
enum REF = "日本語"d;
foreach (I, V; aliasSeqOf!"日本語"c)
Expand Down Expand Up @@ -1157,7 +1157,7 @@ private template SmartAlias(T...) {
}

///
unittest
@safe unittest
{
import std.traits : isImplicitlyConvertible;

Expand All @@ -1169,7 +1169,7 @@ unittest
ubyte, string, short, float, int) == AliasSeq!(ubyte, short)));
}

unittest
@safe unittest
{
static assert(is(typeof({
alias T(T0, int a, double b, alias T1, string c) = AliasSeq!(T0, a, b, T1, c);
Expand All @@ -1189,7 +1189,7 @@ unittest
}

///
unittest
@safe unittest
{
import std.traits : hasMember, ifTestable;

Expand All @@ -1213,7 +1213,7 @@ unittest
}

///
unittest
@safe unittest
{
import std.traits : Largest;

Expand All @@ -1226,7 +1226,7 @@ unittest
}

///
unittest
@safe unittest
{
import std.traits : FunctionAttribute, SetFunctionAttributes;

Expand Down Expand Up @@ -1270,7 +1270,7 @@ template Repeat(size_t n, TList...) if (n > 0)
}

///
unittest
@safe unittest
{
alias ImInt1 = Repeat!(1, immutable(int));
static assert(is(ImInt1 == AliasSeq!(immutable(int))));
Expand All @@ -1289,7 +1289,7 @@ unittest


///
unittest
@safe unittest
{
auto staticArray(T, size_t n)(Repeat!(n, T) elems)
{
Expand Down Expand Up @@ -1328,15 +1328,15 @@ template staticSort(alias cmp, Seq...)
}

///
unittest
@safe unittest
{
alias Nums = AliasSeq!(7, 2, 3, 23);
enum Comp(int N1, int N2) = N1 < N2;
static assert(AliasSeq!(2, 3, 7, 23) == staticSort!(Comp, Nums));
}

///
unittest
@safe unittest
{
alias Types = AliasSeq!(uint, short, ubyte, long, ulong);
enum Comp(T1, T2) = __traits(isUnsigned, T2) - __traits(isUnsigned, T1);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ private template isSame(ab...)
private template expectType(T) {}
private template expectBool(bool b) {}

unittest
@safe unittest
{
static assert( isSame!(int, int));
static assert(!isSame!(int, short));
Expand Down Expand Up @@ -1487,7 +1487,7 @@ private template Pack(T...)
}
}

unittest
@safe unittest
{
static assert( Pack!(1, int, "abc").equals!(1, int, "abc"));
static assert(!Pack!(1, int, "abc").equals!(1, int, "cba"));
Expand Down