Lines Matching refs:assert
221 static assert(is(InoutOf!(int) == inout int));
222 static assert(is(InoutOf!(inout int) == inout int));
223 static assert(is(InoutOf!(const int) == inout const int));
224 static assert(is(InoutOf!(shared int) == inout shared int));
238 static assert(is(ConstOf!(int) == const int));
239 static assert(is(ConstOf!(const int) == const int));
240 static assert(is(ConstOf!(inout int) == const inout int));
241 static assert(is(ConstOf!(shared int) == const shared int));
255 static assert(is(SharedOf!(int) == shared int));
256 static assert(is(SharedOf!(shared int) == shared int));
257 static assert(is(SharedOf!(inout int) == shared inout int));
258 static assert(is(SharedOf!(immutable int) == shared immutable int));
272 static assert(is(SharedInoutOf!(int) == shared inout int));
273 static assert(is(SharedInoutOf!(int) == inout shared int));
275 static assert(is(SharedInoutOf!(const int) == shared inout const int));
276 static assert(is(SharedInoutOf!(immutable int) == shared inout immutable int));
290 static assert(is(SharedConstOf!(int) == shared const int));
291 static assert(is(SharedConstOf!(int) == const shared int));
293 static assert(is(SharedConstOf!(inout int) == shared inout const int));
295 static assert(is(SharedConstOf!(immutable int) == immutable int));
309 static assert(is(SharedConstInoutOf!(int) == shared const inout int));
310 static assert(is(SharedConstInoutOf!(int) == const shared inout int));
311 static assert(is(SharedConstInoutOf!(inout int) == shared inout const int));
313 static assert(is(SharedConstInoutOf!(immutable int) == immutable int));
327 static assert(is(ImmutableOf!(int) == immutable int));
328 static assert(is(ImmutableOf!(const int) == immutable int));
329 static assert(is(ImmutableOf!(inout int) == immutable int));
330 static assert(is(ImmutableOf!(shared int) == immutable int));
335 static assert(is( InoutOf!int == inout int));
336 static assert(is( ConstOf!int == const int));
337 static assert(is( SharedOf!int == shared int));
338 static assert(is(SharedInoutOf!int == shared inout int));
339 static assert(is(SharedConstOf!int == shared const int));
340 static assert(is( ImmutableOf!int == immutable int));
376 static assert(__traits(isSame, QualifierOf!(shared const inout int), SharedConstInoutOf));
377 static assert(__traits(isSame, QualifierOf!(immutable int), ImmutableOf));
378 static assert(__traits(isSame, QualifierOf!(shared int), SharedOf));
379 static assert(__traits(isSame, QualifierOf!(shared inout int), SharedInoutOf));
381 static assert(__traits(isSame, QualifierOf!(int), Alias));
386 …alias Qual1 = QualifierOf!( int); static assert(is(Qual1!long == long));
387 …alias Qual2 = QualifierOf!( inout int); static assert(is(Qual2!long == inout long));
388 …alias Qual3 = QualifierOf!( const int); static assert(is(Qual3!long == const long));
389 …alias Qual4 = QualifierOf!(shared int); static assert(is(Qual4!long == shared long));
390 …alias Qual5 = QualifierOf!(shared inout int); static assert(is(Qual5!long == shared inout long));
391 …alias Qual6 = QualifierOf!(shared const int); static assert(is(Qual6!long == shared const long));
392 …alias Qual7 = QualifierOf!( immutable int); static assert(is(Qual7!long == immutable long));
429 static assert(false, T.stringof ~ " has no parent"); in packageName()
435 static assert(packageName!packageName == "std");
442 static assert(packageName!std == "std");
443 static assert(packageName!(std.traits) == "std"); // this module
444 static assert(packageName!packageName == "std"); // symbol in this module
445 static assert(packageName!(std.array) == "std"); // other module from same package
448 static assert(packageName!core == "core");
449 static assert(packageName!(core.sync) == "core.sync");
450 static assert(packageName!Barrier == "core.sync");
453 static assert(packageName!(X12287!int.i) == "std");
459 static assert(packageName!core == "core"); in version()
460 static assert(packageName!(core.sync) == "core.sync"); in version()
461 static assert(packageName!Barrier == "core.sync"); in version()
467 static assert(packageName!moduleName == "std");
474 static assert(packageName!(isWhite) == "std");
477 static assert(packageName!(Foo.opCall) == "std");
480 static assert(packageName!(vf) == "std");
493 static assert(!T.stringof.startsWith("package "), in moduleName()
512 static assert(moduleName!moduleName == "std.traits");
519 static assert(!__traits(compiles, moduleName!std));
520 static assert(moduleName!(std.traits) == "std.traits"); // this module
521 static assert(moduleName!moduleName == "std.traits"); // symbol in this module
522 static assert(moduleName!(std.array) == "std.array"); // other module
523 static assert(moduleName!(std.array.array) == "std.array"); // symbol in other module
526 static assert(!__traits(compiles, moduleName!(core.sync)));
527 static assert(moduleName!(core.sync.barrier) == "core.sync.barrier");
528 static assert(moduleName!Barrier == "core.sync.barrier");
531 static assert(moduleName!(X12287!int.i) == "std.traits");
538 static assert(moduleName!(isWhite) == "std.ascii");
541 static assert(moduleName!(Foo.opCall) == "std.traits");
544 static assert(moduleName!(vf) == "std.traits");
550 static assert(!__traits(compiles, moduleName!(core.sync))); in version()
551 static assert(moduleName!(core.sync.barrier) == "core.sync.barrier"); in version()
552 static assert(moduleName!Barrier == "core.sync.barrier"); in version()
573 static assert(fullyQualifiedName!fullyQualifiedName == "std.traits.fullyQualifiedName");
666 static assert(fqnSym!fqn == fqn!fqn);
668 static assert(fqn!fqn == "std.traits.fullyQualifiedName");
672 static assert(fqn!(qnTests.Inner) == prefix ~ "Inner");
673 static assert(fqn!(qnTests.func) == prefix ~ "func");
674 static assert(fqn!(qnTests.Data!int) == prefix ~ "Data!(int)");
675 static assert(fqn!(qnTests.Data!int.x) == prefix ~ "Data!(int).x");
676 static assert(fqn!(qnTests.tfunc!(int[])) == prefix ~ "tfunc!(int[])");
677 static assert(fqn!(qnTests.Inst!(Object)) == prefix ~ "Inst!(object.Object)");
678 static assert(fqn!(qnTests.Inst!(Object).x) == prefix ~ "Inst!(object.Object).x");
680 static assert(fqn!(qnTests.Test12309!(int, 10, "str"))
684 static assert(fqn!Barrier == "core.sync.barrier.Barrier");
694 assert("TemplatedStruct.foo" == fullyQualifiedName!(TemplatedStructAlias!().foo));
742 …static assert(0, "New variadic style has been added, please update fullyQualifiedName implementati… in fqnType()
906 … static assert(0, "Unrecognized type " ~ T.stringof ~ ", can't convert to fully qualified string"); in fqnType()
916 static assert(fqn!Ambiguous == fqnType!(Ambiguous, false, false, false, false));
923 static assert(fqn!(string) == "string"); in with()
924 static assert(fqn!(wstring) == "wstring"); in with()
925 static assert(fqn!(dstring) == "dstring"); in with()
926 static assert(fqn!(typeof(null)) == "typeof(null)"); in with()
927 static assert(fqn!(void) == "void"); in with()
928 static assert(fqn!(const(void)) == "const(void)"); in with()
929 static assert(fqn!(shared(void)) == "shared(void)"); in with()
930 static assert(fqn!(shared const(void)) == "const(shared(void))"); in with()
931 static assert(fqn!(shared inout(void)) == "inout(shared(void))"); in with()
932 static assert(fqn!(shared inout const(void)) == "const(shared(void))"); in with()
933 static assert(fqn!(inout(void)) == "inout(void)"); in with()
934 static assert(fqn!(inout const(void)) == "const(void)"); in with()
935 static assert(fqn!(immutable(void)) == "immutable(void)"); in with()
938 static assert(fqn!(Inner) == inner_name); in with()
939 static assert(fqn!(QualifiedEnum) == "std.traits.QualifiedEnum"); // type in with()
940 static assert(fqn!(QualifiedEnum.a) == "std.traits.QualifiedEnum.a"); // symbol in with()
943 static assert(fqn!(typeof(array)) == format("%s[]", inner_name)); in with()
944 static assert(fqn!(typeof(sarray)) == format("%s[16]", inner_name)); in with()
945 static assert(fqn!(typeof(aarray)) == format("%s[%s]", inner_name, inner_name)); in with()
948 … static assert(fqn!(typeof(qualAarray)) == format("const(%s[const(%s)])", inner_name, inner_name)); in with()
951 static assert(fqn!(typeof(data)) == format("shared(const(%s[string])[])", inner_name)); in with()
954 … static assert(fqn!(typeof(func)) == format("const(%s[string])(ref %s, scope lazy string) ref", in with()
956 …static assert(fqn!(typeof(retfunc)) == format("const(%s[string])(return %s) ref", inner_name, inne… in with()
957 … static assert(fqn!(typeof(inoutFunc)) == format("inout(%s(inout(%s)))", inner_name, inner_name)); in with()
958 …static assert(fqn!(typeof(deleg)) == format("const(%s delegate(double, string) nothrow @safe)", in… in with()
959 static assert(fqn!(typeof(inoutDeleg)) == "inout(int) delegate(inout(int)) inout"); in with()
960 … static assert(fqn!(typeof(funcPtr)) == format("%s function(out double, string)", inner_name)); in with()
961 …static assert(fqn!(typeof(cFuncPtr)) == format("extern(C) %s function(double, string)", inner_name… in with()
964 static assert(fqn!(typeof(attrDeleg)) == format("shared(immutable(%s) "~ in with()
968 static assert(fqn!(typeof(cVarArg)) == "extern(C) void(int, ...)"); in with()
969 static assert(fqn!(typeof(dVarArg)) == "void(...)"); in with()
970 static assert(fqn!(typeof(dVarArg2)) == "void(int, ...)"); in with()
971 static assert(fqn!(typeof(typesafeVarArg)) == "void(int[] ...)"); in with()
976 static assert(fqn!(__vector(float[4])) == "__vector(float[4])"); in with()
995 static assert(0, "argument has no return type");
1013 static assert(is(ShouldBeInt == int));
1016 static assert(is(ReturnType!g == int));
1020 static assert(is(pg == int));
1027 static assert(is(ReturnType!C == int));
1030 static assert(is(ReturnType!c == int));
1037 static assert(is(R_Test_prop == int));
1040 static assert(is(R_dglit == int));
1054 static assert(0, "argument has no parameters");
1073 static assert(is(ParameterTypeTuple!foo == AliasSeq!(int, bool)));
1074 static assert(is(ParameterTypeTuple!(typeof(&foo)) == AliasSeq!(int, bool)));
1078 static assert(is(ParameterTypeTuple!S == AliasSeq!(real, int)));
1079 static assert(is(ParameterTypeTuple!(S*) == AliasSeq!(real, int)));
1080 static assert(is(ParameterTypeTuple!s == AliasSeq!(real, int)));
1087 static assert(P_Test_prop.length == 0);
1090 static assert(P_dglit.length == 1);
1091 static assert(is(P_dglit[0] == int));
1108 static assert(arity!foo == 0);
1110 static assert(arity!bar == 1);
1112 static assert(!__traits(compiles, arity!variadicFoo));
1119 static assert(arity!TheType == 1);
1167 static assert(0, func[0].stringof ~ " is not a function"); in ParameterStorageClassTuple()
1181 static assert(pstc.length == 4); // number of parameters
1182 static assert(pstc[0] == STC.ref_);
1183 static assert(pstc[1] == STC.out_);
1188 static assert(pstc[2] == STC.in_); in version()
1190 static assert(pstc[2] == STC.scope_); in version()
1192 static assert(pstc[3] == STC.none);
1241 static assert(param1 == ParameterStorageClass.ref_);
1246 static assert(param2 == ParameterStorageClass.out_);
1252 static assert(param3 == (ParameterStorageClass.ref_ | ParameterStorageClass.out_));
1260 static assert(ParameterStorageClassTuple!noparam.length == 0);
1264 static assert(test_pstc.length == 6);
1265 static assert(test_pstc[0] == STC.scope_);
1266 static assert(test_pstc[1] == STC.ref_);
1267 static assert(test_pstc[2] == STC.out_);
1268 static assert(test_pstc[3] == STC.lazy_);
1269 static assert(test_pstc[4] == STC.none);
1270 static assert(test_pstc[5] == STC.return_);
1280 static assert(test_const_pstc.length == 1);
1281 static assert(test_const_pstc[0] == STC.none);
1284 static assert(test_sharedconst_pstc.length == 1);
1285 static assert(test_sharedconst_pstc[0] == STC.none);
1288 static assert(dglit_pstc.length == 1);
1289 static assert(dglit_pstc[0] == STC.ref_);
1293 static assert(ParameterStorageClassTuple!(typeof(func))[0] == STC.none);
1333 static assert(0, func.stringof ~ " is not a function");
1355 static assert([ParameterIdentifierTuple!foo] == ["num", "name", ""]);
1364 static assert([ParameterIdentifierTuple!foo] == [""]);
1365 static assert([ParameterIdentifierTuple!bar] == [""]);
1373 static assert([PIT!bar] == ["num", "name", "array"]);
1377 static assert([PIT!fp] == ["", ""]);
1381 static assert([PIT!dg] == ["", "", ""]);
1389 static assert([PIT!(Test.getter)] == []);
1390 static assert([PIT!(Test.setter)] == ["a"]);
1391 static assert([PIT!(Test.method)] == ["a", "b", "c"]);
1396 static assert([PIT!baw] == ["_param_0", "_param_1", "_param_2"]);
1400 static assert([PIT!baz] == ["_param_0", "_param_1", "_param_2"]);
1450 static assert(0, func.stringof ~ " is not a function");
1472 static assert(is(ParameterDefaults!foo[0] == void));
1473 static assert( ParameterDefaults!foo[1] == "hello");
1474 static assert( ParameterDefaults!foo[2] == [1,2,3]);
1475 static assert( ParameterDefaults!foo[3] == 0);
1486 static assert(Voids.length == 12);
1487 static foreach (V; Voids) static assert(is(V == void));
1498 static assert(__traits(compiles, ParameterDefaults!(S.__ctor)));
1511 static assert(PDVT!bar.length == 2);
1512 static assert(PDVT!bar[0] == 1);
1513 static assert(PDVT!bar[1] == "hello");
1514 static assert(is(typeof(PDVT!bar) == typeof(AliasSeq!(1, "hello"))));
1517 static assert(PDVT!baz.length == 3);
1518 static assert(is(PDVT!baz[0] == void));
1519 static assert( PDVT!baz[1] == 1);
1520 static assert( PDVT!baz[2] == "hello");
1521 static assert(is(typeof(PDVT!baz) == typeof(AliasSeq!(void, 1, "hello"))));
1526 static assert(PDVT!foo.length == 1);
1527 static assert(PDVT!foo[0] == 3);
1528 static assert(is(typeof(PDVT!foo) == typeof(AliasSeq!(3))));
1539 static assert(PDVT!bug8106[0] == Colour.white);
1542 static assert(PDVT!bug16582[0] is null);
1596 static assert(functionAttributes!func & FA.pure_);
1597 static assert(functionAttributes!func & FA.safe);
1598 static assert(!(functionAttributes!func & FA.trusted)); // not @trusted
1628 static assert(functionAttributes!(S.noF) == FA.system);
1629 static assert(functionAttributes!(typeof(S.noF)) == FA.system);
1631 static assert(functionAttributes!(S.constF) == (FA.const_ | FA.system));
1632 static assert(functionAttributes!(typeof(S.constF)) == (FA.const_ | FA.system));
1634 static assert(functionAttributes!(S.immutableF) == (FA.immutable_ | FA.system));
1635 static assert(functionAttributes!(typeof(S.immutableF)) == (FA.immutable_ | FA.system));
1637 static assert(functionAttributes!(S.inoutF) == (FA.inout_ | FA.system));
1638 static assert(functionAttributes!(typeof(S.inoutF)) == (FA.inout_ | FA.system));
1640 static assert(functionAttributes!(S.sharedF) == (FA.shared_ | FA.system));
1641 static assert(functionAttributes!(typeof(S.sharedF)) == (FA.shared_ | FA.system));
1643 static assert(functionAttributes!(S.refF) == (FA.ref_ | FA.system | FA.return_));
1644 static assert(functionAttributes!(typeof(S.refF)) == (FA.ref_ | FA.system | FA.return_));
1646 static assert(functionAttributes!(S.propertyF) == (FA.property | FA.system));
1647 static assert(functionAttributes!(typeof(&S.propertyF)) == (FA.property | FA.system));
1649 static assert(functionAttributes!(S.nothrowF) == (FA.nothrow_ | FA.system));
1650 static assert(functionAttributes!(typeof(S.nothrowF)) == (FA.nothrow_ | FA.system));
1652 static assert(functionAttributes!(S.nogcF) == (FA.nogc | FA.system));
1653 static assert(functionAttributes!(typeof(S.nogcF)) == (FA.nogc | FA.system));
1655 static assert(functionAttributes!(S.systemF) == FA.system);
1656 static assert(functionAttributes!(typeof(S.systemF)) == FA.system);
1658 static assert(functionAttributes!(S.trustedF) == FA.trusted);
1659 static assert(functionAttributes!(typeof(S.trustedF)) == FA.trusted);
1661 static assert(functionAttributes!(S.safeF) == FA.safe);
1662 static assert(functionAttributes!(typeof(S.safeF)) == FA.safe);
1664 static assert(functionAttributes!(S.pureF) == (FA.pure_ | FA.system));
1665 static assert(functionAttributes!(typeof(S.pureF)) == (FA.pure_ | FA.system));
1667 static assert(functionAttributes!(S.liveF) == (FA.live | FA.system));
1668 static assert(functionAttributes!(typeof(S.liveF)) == (FA.live | FA.system));
1675 static assert(functionAttributes!(pure_nothrow) == (FA.pure_ | FA.nothrow_ | FA.system));
1676 … static assert(functionAttributes!(typeof(pure_nothrow)) == (FA.pure_ | FA.nothrow_ | FA.system));
1678 static assert(functionAttributes!(safe_nothrow) == (FA.safe | FA.nothrow_));
1679 static assert(functionAttributes!(typeof(safe_nothrow)) == (FA.safe | FA.nothrow_));
1681 static assert(functionAttributes!(static_ref_property) == (FA.property | FA.ref_ | FA.system));
1682 …static assert(functionAttributes!(typeof(&static_ref_property)) == (FA.property | FA.ref_ | FA.sys…
1684 static assert(functionAttributes!(ref_property) == (FA.property | FA.ref_ | FA.system));
1685 … static assert(functionAttributes!(typeof(&ref_property)) == (FA.property | FA.ref_ | FA.system));
1693 static assert(functionAttributes!(S2.pure_const) == (FA.const_ | FA.pure_ | FA.system));
1694 static assert(functionAttributes!(typeof(S2.pure_const)) == (FA.const_ | FA.pure_ | FA.system));
1696 …static assert(functionAttributes!(S2.pure_sharedconst) == (FA.const_ | FA.shared_ | FA.pure_ | FA.…
1697 …static assert(functionAttributes!(typeof(S2.pure_sharedconst)) == (FA.const_ | FA.shared_ | FA.pur…
1699 static assert(functionAttributes!((int a) { }) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.safe));
1700 …static assert(functionAttributes!(typeof((int a) { })) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.s…
1703 static assert(functionAttributes!(safeDel) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.safe));
1704 …static assert(functionAttributes!(typeof(safeDel)) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.safe)…
1707 … static assert(functionAttributes!(trustedDel) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.trusted));
1708 …static assert(functionAttributes!(typeof(trustedDel)) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.tr…
1711 static assert(functionAttributes!(systemDel) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.system));
1712 …static assert(functionAttributes!(typeof(systemDel)) == (FA.pure_ | FA.nothrow_ | FA.nogc | FA.sys…
1738 default: assert(0, attrib);
1779 static assert(hasFunctionAttributes!(func, "@safe", "pure"));
1780 static assert(!hasFunctionAttributes!(func, "@trusted"));
1787 static assert(hasFunctionAttributes!(myFunc!bool, "@safe", "pure", "@nogc", "nothrow"));
1788 static assert(!hasFunctionAttributes!(myFunc!bool, "shared"));
1816 static assert(hasFunctionAttributes!(S.noF));
1818 static assert(hasFunctionAttributes!(S.noF, "@system"));
1819 static assert(hasFunctionAttributes!(typeof(S.noF), "@system"));
1820 static assert(!hasFunctionAttributes!(S.noF, "@system", "pure"));
1822 static assert(hasFunctionAttributes!(S.constF, "const", "@system"));
1823 static assert(hasFunctionAttributes!(typeof(S.constF), "const", "@system"));
1824 static assert(!hasFunctionAttributes!(S.constF, "const", "@system", "@nogc"));
1826 static assert(hasFunctionAttributes!(S.immutableF, "immutable", "@system"));
1827 static assert(hasFunctionAttributes!(typeof(S.immutableF), "immutable", "@system"));
1828 static assert(!hasFunctionAttributes!(S.immutableF, "immutable", "@system", "pure"));
1830 static assert(hasFunctionAttributes!(S.inoutF, "inout", "@system"));
1831 static assert(hasFunctionAttributes!(typeof(S.inoutF), "inout", "@system"));
1832 static assert(!hasFunctionAttributes!(S.inoutF, "inout", "@system", "pure"));
1834 static assert(hasFunctionAttributes!(S.sharedF, "shared", "@system"));
1835 static assert(hasFunctionAttributes!(typeof(S.sharedF), "shared", "@system"));
1836 static assert(!hasFunctionAttributes!(S.sharedF, "shared", "@system", "@trusted"));
1838 static assert(hasFunctionAttributes!(S.refF, "ref", "@system", "return"));
1839 static assert(hasFunctionAttributes!(typeof(S.refF), "ref", "@system", "return"));
1840 static assert(!hasFunctionAttributes!(S.refF, "ref", "@system", "return", "pure"));
1842 static assert(hasFunctionAttributes!(S.propertyF, "@property", "@system"));
1843 static assert(hasFunctionAttributes!(typeof(&S.propertyF), "@property", "@system"));
1844 static assert(!hasFunctionAttributes!(S.propertyF, "@property", "@system", "ref"));
1846 static assert(hasFunctionAttributes!(S.nothrowF, "nothrow", "@system"));
1847 static assert(hasFunctionAttributes!(typeof(S.nothrowF), "nothrow", "@system"));
1848 static assert(!hasFunctionAttributes!(S.nothrowF, "nothrow", "@system", "@trusted"));
1850 static assert(hasFunctionAttributes!(S.nogcF, "@nogc", "@system"));
1851 static assert(hasFunctionAttributes!(typeof(S.nogcF), "@nogc", "@system"));
1852 static assert(!hasFunctionAttributes!(S.nogcF, "@nogc", "@system", "ref"));
1854 static assert(hasFunctionAttributes!(S.systemF, "@system"));
1855 static assert(hasFunctionAttributes!(typeof(S.systemF), "@system"));
1856 static assert(!hasFunctionAttributes!(S.systemF, "@system", "ref"));
1858 static assert(hasFunctionAttributes!(S.trustedF, "@trusted"));
1859 static assert(hasFunctionAttributes!(typeof(S.trustedF), "@trusted"));
1860 static assert(!hasFunctionAttributes!(S.trustedF, "@trusted", "@safe"));
1862 static assert(hasFunctionAttributes!(S.safeF, "@safe"));
1863 static assert(hasFunctionAttributes!(typeof(S.safeF), "@safe"));
1864 static assert(!hasFunctionAttributes!(S.safeF, "@safe", "nothrow"));
1866 static assert(hasFunctionAttributes!(S.pureF, "pure", "@system"));
1867 static assert(hasFunctionAttributes!(typeof(S.pureF), "pure", "@system"));
1868 static assert(!hasFunctionAttributes!(S.pureF, "pure", "@system", "ref"));
1870 static assert(hasFunctionAttributes!(S.liveF, "@live", "@system"));
1871 static assert(hasFunctionAttributes!(typeof(S.liveF), "@live", "@system"));
1872 static assert(!hasFunctionAttributes!(S.liveF, "@live", "@system", "ref"));
1879 static assert(hasFunctionAttributes!(pure_nothrow, "pure", "nothrow", "@safe"));
1880 static assert(hasFunctionAttributes!(typeof(pure_nothrow), "pure", "nothrow", "@safe"));
1881 static assert(!hasFunctionAttributes!(pure_nothrow, "pure", "nothrow", "@safe", "@trusted"));
1883 static assert(hasFunctionAttributes!(safe_nothrow, "@safe", "nothrow"));
1884 static assert(hasFunctionAttributes!(typeof(safe_nothrow), "@safe", "nothrow"));
1885 static assert(hasFunctionAttributes!(safe_nothrow, "@safe", "nothrow", "pure"));
1886 static assert(!hasFunctionAttributes!(safe_nothrow, "@safe", "nothrow", "pure", "@trusted"));
1888 static assert(hasFunctionAttributes!(static_ref_property, "@property", "ref", "@safe"));
1889 … static assert(hasFunctionAttributes!(typeof(&static_ref_property), "@property", "ref", "@safe"));
1890 …static assert(hasFunctionAttributes!(static_ref_property, "@property", "ref", "@safe", "nothrow"));
1891 …static assert(!hasFunctionAttributes!(static_ref_property, "@property", "ref", "@safe", "nothrow",…
1893 static assert(hasFunctionAttributes!(ref_property, "@property", "ref", "@safe"));
1894 static assert(hasFunctionAttributes!(typeof(&ref_property), "@property", "ref", "@safe"));
1895 static assert(!hasFunctionAttributes!(ref_property, "@property", "ref", "@safe", "@nogc"));
1903 static assert(hasFunctionAttributes!(S2.pure_const, "const", "pure", "@system"));
1904 static assert(hasFunctionAttributes!(typeof(S2.pure_const), "const", "pure", "@system"));
1905 static assert(!hasFunctionAttributes!(S2.pure_const, "const", "pure", "@system", "ref"));
1907 … static assert(hasFunctionAttributes!(S2.pure_sharedconst, "const", "shared", "pure", "@system"));
1908 …static assert(hasFunctionAttributes!(typeof(S2.pure_sharedconst), "const", "shared", "pure", "@sys…
1909 …static assert(!hasFunctionAttributes!(S2.pure_sharedconst, "const", "shared", "pure", "@system", "…
1911 static assert(hasFunctionAttributes!((int a) { }, "pure", "nothrow", "@nogc", "@safe"));
1912 static assert(hasFunctionAttributes!(typeof((int a) { }), "pure", "nothrow", "@nogc", "@safe"));
1913 static assert(!hasFunctionAttributes!((int a) { }, "pure", "nothrow", "@nogc", "@safe", "ref"));
1916 static assert(hasFunctionAttributes!(safeDel, "pure", "nothrow", "@nogc", "@safe"));
1917 static assert(hasFunctionAttributes!(typeof(safeDel), "pure", "nothrow", "@nogc", "@safe"));
1918 static assert(!hasFunctionAttributes!(safeDel, "pure", "nothrow", "@nogc", "@safe", "@system"));
1921 static assert(hasFunctionAttributes!(trustedDel, "pure", "nothrow", "@nogc", "@trusted"));
1922 … static assert(hasFunctionAttributes!(typeof(trustedDel), "pure", "nothrow", "@nogc", "@trusted"));
1923 … static assert(!hasFunctionAttributes!(trustedDel, "pure", "nothrow", "@nogc", "@trusted", "ref"));
1926 static assert(hasFunctionAttributes!(systemDel, "pure", "nothrow", "@nogc", "@system"));
1927 static assert(hasFunctionAttributes!(typeof(systemDel), "pure", "nothrow", "@nogc", "@system"));
1928 …static assert(!hasFunctionAttributes!(systemDel, "pure", "nothrow", "@nogc", "@system", "@property…
1933 assert(pure_nothrow == 0);
1935 assert(static_ref_property == 0);
1936 assert(ref_property == 0);
1937 assert(S2().pure_const == 0);
1938 assert((shared S2()).pure_sharedconst == 0);
1962 static assert( isSafe!add);
1963 static assert( isSafe!sub);
1964 static assert(!isSafe!mul);
1977 static assert( isSafe!(Set.safeF));
1978 static assert( isSafe!(Set.trustedF));
1979 static assert(!isSafe!(Set.systemF));
1986 static assert( isSafe!safeFunc);
1987 static assert( isSafe!trustedFunc);
1988 static assert(!isSafe!systemFunc);
1995 static assert( isSafe!safeDel);
1996 static assert( isSafe!trustedDel);
1997 static assert(!isSafe!systemDel);
2000 static assert( isSafe!({safeDel();}));
2001 static assert( isSafe!({trustedDel();}));
2002 static assert(!isSafe!({systemDel();}));
2009 static assert( isSafe!(SafeStatic()));
2010 static assert( isSafe!(TrustedStatic()));
2011 static assert(!isSafe!(SystemStatic()));
2018 static assert( isSafe!(Safe.init()));
2019 static assert( isSafe!(Trusted.init()));
2020 static assert(!isSafe!(System.init()));
2039 static assert(!isUnsafe!add);
2040 static assert(!isUnsafe!sub);
2041 static assert( isUnsafe!mul);
2053 static assert(!isUnsafe!(Set.safeF));
2054 static assert(!isUnsafe!(Set.trustedF));
2055 static assert( isUnsafe!(Set.systemF));
2062 static assert(!isUnsafe!safeFunc);
2063 static assert(!isUnsafe!trustedFunc);
2064 static assert( isUnsafe!systemFunc);
2071 static assert(!isUnsafe!safeDel);
2072 static assert(!isUnsafe!trustedDel);
2073 static assert( isUnsafe!systemDel);
2076 static assert(!isUnsafe!({safeDel();}));
2077 static assert(!isUnsafe!({trustedDel();}));
2078 static assert( isUnsafe!({systemDel();}));
2085 static assert(!isUnsafe!(SafeStatic()));
2086 static assert(!isUnsafe!(TrustedStatic()));
2087 static assert( isUnsafe!(SystemStatic()));
2094 static assert(!isUnsafe!(Safe.init()));
2095 static assert(!isUnsafe!(Trusted.init()));
2096 static assert( isUnsafe!(System.init()));
2118 static assert(functionLinkage!Dfunc == "D");
2119 static assert(functionLinkage!Cfunc == "C");
2122 assert(a == "D");
2126 assert(b == "C");
2136 static assert(functionLinkage!(Test.const_func) == "D");
2137 static assert(functionLinkage!(Test.sharedconst_func) == "D");
2139 static assert(functionLinkage!((int a){}) == "D");
2180 static assert(variadicFunctionStyle!func == Variadic.no);
2183 static assert(variadicFunctionStyle!printf == Variadic.c);
2195 static assert(variadicFunctionStyle!novar == Variadic.no);
2196 static assert(variadicFunctionStyle!cstyle == Variadic.c);
2197 static assert(variadicFunctionStyle!dstyle == Variadic.d);
2198 static assert(variadicFunctionStyle!typesafe == Variadic.typesafe);
2200 static assert(variadicFunctionStyle!((int[] a...) {}) == Variadic.typesafe);
2242 static assert(0);
2245 static assert(0);
2255 static assert(is( typeof(C.value) == int ));
2256 static assert(is( FunctionTypeOf!(C.value) == function ));
2266 static assert(is( typeof(test) == FunctionTypeOf!(typeof(test)) ));
2267 static assert(is( typeof(test) == FunctionTypeOf!test ));
2268 static assert(is( typeof(test) == FunctionTypeOf!test_fp ));
2269 static assert(is( typeof(test) == FunctionTypeOf!test_dg ));
2272 static assert(is( FunctionTypeOf!propGet == GetterType ));
2273 static assert(is( FunctionTypeOf!propSet == SetterType ));
2277 static assert(is( FunctionTypeOf!(Prop.prop) == GetterType ));
2278 static assert(is( FunctionTypeOf!(prop.prop) == GetterType ));
2282 static assert(is( FunctionTypeOf!call == typeof(test) ));
2287 static assert(is( FunctionTypeOf!stcall_val == typeof(test) ));
2288 static assert(is( FunctionTypeOf!stcall_ptr == typeof(test) ));
2291 static assert(is( FunctionTypeOf!TemplatedOpCallF == typeof(TemplatedOpCallF.opCall!()) ));
2295 static assert(is( FunctionTypeOf!TemplatedOpCallDg == typeof(TemplatedOpCallDg.opCall!()) ));
2309 static assert(is(F_ov0* == void function(string)));
2310 static assert(is(F_ov1* == real function(real)));
2311 static assert(is(F_ov2* == int function(int)));
2312 static assert(is(F_ov3* == int function() @property));
2315 static assert(is(F_dglit* : int function(int)));
2336 static assert(!(attrs & FunctionAttribute.trusted) ||
2341 static assert(canFind(linkages, linkage), "Invalid linkage '" ~
2439 assert(g() > 0);
2465 static assert(is(SetFunctionAttributes!(T, linkage, attrs) == T),
2474 static assert(functionLinkage!New == newLinkage,
2482 static assert(functionAttributes!T1 == FA.safe);
2490 static assert(functionAttributes!T2 == allAttrs);
2494 static assert(is(T3 == T));
2544 static assert(!isInnerClass!C);
2554 static assert(isInnerClass!(Outer1.Inner1));
2555 static assert(!isInnerClass!(Outer1.Inner2));
2564 static assert(!isInnerClass!(Outer2.Inner));
2581 static assert(!isNested!S);
2585 static assert(isNested!NestedStruct);
2617 static assert(!hasNested!(S[2]));
2618 static assert(hasNested!(NS[2]));
2623 static assert(!__traits(compiles, isNested!int));
2624 static assert(!hasNested!int);
2627 static assert(!isNested!StaticStruct);
2628 static assert(!hasNested!StaticStruct);
2632 static assert( isNested!NestedStruct);
2633 static assert( hasNested!NestedStruct);
2634 static assert( isNested!(immutable NestedStruct));
2635 static assert( hasNested!(immutable NestedStruct));
2637 static assert(!__traits(compiles, isNested!(NestedStruct[1])));
2638 static assert( hasNested!(NestedStruct[1]));
2639 static assert(!hasNested!(NestedStruct[0]));
2642 static assert(!isNested!S1);
2643 static assert( hasNested!S1);
2646 static assert(!isNested!S2);
2647 static assert( hasNested!S2);
2650 static assert(!isNested!S3);
2651 static assert(!hasNested!S3);
2654 static assert(!isNested!U);
2655 static assert( hasNested!U);
2658 static assert(!isNested!StaticClass);
2659 static assert(!hasNested!StaticClass);
2662 static assert( isNested!NestedClass);
2663 static assert( hasNested!NestedClass);
2664 static assert( isNested!(immutable NestedClass));
2665 static assert( hasNested!(immutable NestedClass));
2667 static assert(!__traits(compiles, isNested!(NestedClass[1])));
2668 static assert( hasNested!(NestedClass[1]));
2669 static assert(!hasNested!(NestedClass[0]));
2675 static assert(!hasNested!A);
2701 static assert(is(Fields!S == AliasSeq!(int, float)));
2711 static assert(is(FieldTypeTuple!int == AliasSeq!int));
2714 static assert(is(FieldTypeTuple!StaticStruct1 == AliasSeq!()));
2717 static assert(is(FieldTypeTuple!StaticStruct2 == AliasSeq!(int, int)));
2722 static assert(is(FieldTypeTuple!NestedStruct1 == AliasSeq!()));
2725 static assert(is(FieldTypeTuple!NestedStruct2 == AliasSeq!int));
2728 static assert(is(FieldTypeTuple!NestedClass == AliasSeq!int));
2731 static assert(is(Fields!I == AliasSeq!()));
2765 static assert(FieldNameTuple!S == AliasSeq!("x", "y"));
2766 static assert(FieldNameTuple!int == AliasSeq!"");
2771 static assert(FieldNameTuple!int == AliasSeq!"");
2774 static assert(is(FieldNameTuple!StaticStruct1 == AliasSeq!()));
2777 static assert(FieldNameTuple!StaticStruct2 == AliasSeq!("a", "b"));
2780 static assert(is(FieldNameTuple!StaticClass1 == AliasSeq!()));
2783 static assert(FieldNameTuple!StaticClass2 == AliasSeq!("a", "b"));
2786 static assert(FieldNameTuple!StaticClass3 == AliasSeq!("c"));
2791 static assert(is(FieldNameTuple!NestedStruct1 == AliasSeq!()));
2794 static assert(FieldNameTuple!NestedStruct2 == AliasSeq!"a");
2797 static assert(FieldNameTuple!NestedClass == AliasSeq!"a");
2800 static assert(FieldNameTuple!I == AliasSeq!());
2826 assert(R.length == 4
2834 static assert(is(S1 == AliasSeq!int));
2839 static assert(is(RepresentationTypeTuple!S2 == AliasSeq!int));
2840 static assert(is(RepresentationTypeTuple!S3 == AliasSeq!(int, char)));
2841 static assert(is(RepresentationTypeTuple!S4 == AliasSeq!(int, int, int, char)));
2846 assert(R.length == 4
2852 static assert(R1.length == 2 && is(R1[0] == int) && is(R1[1] == float));
2859 static assert(R2.length == 2 && is(R2[0] == int) && is(R2[1] == immutable(Object)));
2861 static assert(is(RepresentationTypeTuple!noreturn == AliasSeq!noreturn));
2919 static assert(!hasRawAliasing!int);
2920 static assert( hasRawAliasing!(char*));
2922 static assert(!hasRawAliasing!Object);
2924 static assert( hasRawAliasing!(int[]));
2927 static assert(!hasRawAliasing!S1);
2930 static assert(!hasRawAliasing!S2);
2940 static assert(hasRawAliasing!C);
2947 static assert( hasRawAliasing!S3);
2950 static assert( hasRawAliasing!S4);
2952 static assert( hasRawAliasing!S3);
2953 static assert( hasRawAliasing!S4);
2954 static assert(!hasRawAliasing!S5);
2958 static assert(!hasRawAliasing!S6);
2959 static assert( hasRawAliasing!S7);
2961 static assert(!hasRawAliasing!(void delegate()));
2962 static assert(!hasRawAliasing!(void delegate() const));
2963 static assert(!hasRawAliasing!(void delegate() immutable));
2964 static assert(!hasRawAliasing!(void delegate() shared));
2965 static assert(!hasRawAliasing!(void delegate() shared const));
2966 static assert(!hasRawAliasing!(const(void delegate())));
2967 static assert(!hasRawAliasing!(immutable(void delegate())));
2972 static assert(!hasRawAliasing!S8);
2973 static assert(!hasRawAliasing!S12);
2974 static assert( hasRawAliasing!S13);
2977 static assert(!hasRawAliasing!S9);
2982 static assert( hasRawAliasing!S10);
2983 static assert(!hasRawAliasing!S11);
2985 static assert( hasRawAliasing!(int[string]));
2986 static assert(!hasRawAliasing!(immutable(int[string])));
3022 static assert(!hasRawUnsharedAliasing!int);
3023 static assert( hasRawUnsharedAliasing!(char*));
3024 static assert(!hasRawUnsharedAliasing!(shared char*));
3026 static assert(!hasRawUnsharedAliasing!Object);
3028 static assert( hasRawUnsharedAliasing!(int[]));
3029 static assert(!hasRawUnsharedAliasing!(shared int[]));
3032 static assert(!hasRawUnsharedAliasing!S1);
3035 static assert(!hasRawUnsharedAliasing!S2);
3038 static assert( hasRawUnsharedAliasing!S3);
3040 static assert(!hasRawUnsharedAliasing!S4);
3047 static assert( hasRawUnsharedAliasing!S3);
3049 static assert(!hasRawUnsharedAliasing!S4);
3052 static assert( hasRawUnsharedAliasing!S5);
3054 static assert(!hasRawUnsharedAliasing!S6);
3056 static assert( hasRawUnsharedAliasing!S5);
3057 static assert(!hasRawUnsharedAliasing!S6);
3058 static assert(!hasRawUnsharedAliasing!S7);
3063 static assert(!hasRawUnsharedAliasing!S8);
3064 static assert( hasRawUnsharedAliasing!S9);
3065 static assert(!hasRawUnsharedAliasing!S10);
3067 static assert(!hasRawUnsharedAliasing!(void delegate()));
3068 static assert(!hasRawUnsharedAliasing!(void delegate() const));
3069 static assert(!hasRawUnsharedAliasing!(void delegate() immutable));
3070 static assert(!hasRawUnsharedAliasing!(void delegate() shared));
3071 static assert(!hasRawUnsharedAliasing!(void delegate() shared const));
3072 static assert(!hasRawUnsharedAliasing!(const(void delegate())));
3073 static assert(!hasRawUnsharedAliasing!(const(void delegate() const)));
3074 static assert(!hasRawUnsharedAliasing!(const(void delegate() immutable)));
3075 static assert(!hasRawUnsharedAliasing!(const(void delegate() shared)));
3076 static assert(!hasRawUnsharedAliasing!(const(void delegate() shared const)));
3077 static assert(!hasRawUnsharedAliasing!(immutable(void delegate())));
3078 static assert(!hasRawUnsharedAliasing!(immutable(void delegate() const)));
3079 static assert(!hasRawUnsharedAliasing!(immutable(void delegate() immutable)));
3080 static assert(!hasRawUnsharedAliasing!(immutable(void delegate() shared)));
3081 static assert(!hasRawUnsharedAliasing!(immutable(void delegate() shared const)));
3082 static assert(!hasRawUnsharedAliasing!(shared(void delegate())));
3083 static assert(!hasRawUnsharedAliasing!(shared(void delegate() const)));
3084 static assert(!hasRawUnsharedAliasing!(shared(void delegate() immutable)));
3085 static assert(!hasRawUnsharedAliasing!(shared(void delegate() shared)));
3086 static assert(!hasRawUnsharedAliasing!(shared(void delegate() shared const)));
3087 static assert(!hasRawUnsharedAliasing!(shared(const(void delegate()))));
3088 static assert(!hasRawUnsharedAliasing!(shared(const(void delegate() const))));
3089 static assert(!hasRawUnsharedAliasing!(shared(const(void delegate() immutable))));
3090 static assert(!hasRawUnsharedAliasing!(shared(const(void delegate() shared))));
3091 static assert(!hasRawUnsharedAliasing!(shared(const(void delegate() shared const))));
3092 static assert(!hasRawUnsharedAliasing!(void function()));
3095 static assert(!hasRawUnsharedAliasing!S13);
3101 static assert( hasRawUnsharedAliasing!S14);
3102 static assert(!hasRawUnsharedAliasing!S15);
3103 static assert(!hasRawUnsharedAliasing!S16);
3105 static assert( hasRawUnsharedAliasing!(int[string]));
3106 static assert(!hasRawUnsharedAliasing!(shared(int[string])));
3107 static assert(!hasRawUnsharedAliasing!(immutable(int[string])));
3134 static assert(!hasRawUnsharedAliasing!S17);
3135 static assert(!hasRawUnsharedAliasing!(immutable(S17)));
3136 static assert(!hasRawUnsharedAliasing!(shared(S17)));
3137 static assert(!hasRawUnsharedAliasing!S18);
3138 static assert(!hasRawUnsharedAliasing!(immutable(S18)));
3139 static assert(!hasRawUnsharedAliasing!(shared(S18)));
3140 static assert(!hasRawUnsharedAliasing!S19);
3141 static assert(!hasRawUnsharedAliasing!(immutable(S19)));
3142 static assert(!hasRawUnsharedAliasing!(shared(S19)));
3143 static assert( hasRawUnsharedAliasing!S20);
3144 static assert(!hasRawUnsharedAliasing!(immutable(S20)));
3145 static assert(!hasRawUnsharedAliasing!(shared(S20)));
3146 static assert(!hasRawUnsharedAliasing!S21);
3147 static assert(!hasRawUnsharedAliasing!(immutable(S21)));
3148 static assert(!hasRawUnsharedAliasing!(shared(S21)));
3149 static assert(!hasRawUnsharedAliasing!S22);
3150 static assert(!hasRawUnsharedAliasing!(immutable(S22)));
3151 static assert(!hasRawUnsharedAliasing!(shared(S22)));
3152 static assert(!hasRawUnsharedAliasing!S23);
3153 static assert(!hasRawUnsharedAliasing!(immutable(S23)));
3154 static assert(!hasRawUnsharedAliasing!(shared(S23)));
3155 static assert( hasRawUnsharedAliasing!S24);
3156 static assert(!hasRawUnsharedAliasing!(immutable(S24)));
3157 static assert(!hasRawUnsharedAliasing!(shared(S24)));
3162 static assert(!hasRawUnsharedAliasing!S25);
3163 static assert(!hasRawUnsharedAliasing!S26);
3164 static assert(!hasRawUnsharedAliasing!S27);
3165 static assert(!hasRawUnsharedAliasing!S28);
3235 static assert( hasAliasing!S1);
3236 static assert(!hasAliasing!S2);
3237 static assert(!hasAliasing!S3);
3238 static assert(!hasAliasing!S4);
3243 static assert( hasAliasing!(uint[uint]));
3244 static assert(!hasAliasing!(immutable(uint[uint])));
3245 static assert( hasAliasing!(void delegate()));
3246 static assert( hasAliasing!(void delegate() const));
3247 static assert(!hasAliasing!(void delegate() immutable));
3248 static assert( hasAliasing!(void delegate() shared));
3249 static assert( hasAliasing!(void delegate() shared const));
3250 static assert( hasAliasing!(const(void delegate())));
3251 static assert( hasAliasing!(const(void delegate() const)));
3252 static assert(!hasAliasing!(const(void delegate() immutable)));
3253 static assert( hasAliasing!(const(void delegate() shared)));
3254 static assert( hasAliasing!(const(void delegate() shared const)));
3255 static assert(!hasAliasing!(immutable(void delegate())));
3256 static assert(!hasAliasing!(immutable(void delegate() const)));
3257 static assert(!hasAliasing!(immutable(void delegate() immutable)));
3258 static assert(!hasAliasing!(immutable(void delegate() shared)));
3259 static assert(!hasAliasing!(immutable(void delegate() shared const)));
3260 static assert( hasAliasing!(shared(const(void delegate()))));
3261 static assert( hasAliasing!(shared(const(void delegate() const))));
3262 static assert(!hasAliasing!(shared(const(void delegate() immutable))));
3263 static assert( hasAliasing!(shared(const(void delegate() shared))));
3264 static assert( hasAliasing!(shared(const(void delegate() shared const))));
3265 static assert(!hasAliasing!(void function()));
3268 static assert( hasAliasing!I);
3271 static assert( hasAliasing!(Rebindable!(const Object)));
3272 static assert(!hasAliasing!(Rebindable!(immutable Object)));
3273 static assert( hasAliasing!(Rebindable!(shared Object)));
3274 static assert( hasAliasing!(Rebindable!Object));
3284 static assert(!hasAliasing!S5);
3285 static assert( hasAliasing!S6);
3291 static assert( hasAliasing!S7);
3292 static assert( hasAliasing!S8);
3293 static assert( hasAliasing!S9);
3294 static assert( hasAliasing!S10);
3299 static assert(!hasAliasing!S11);
3300 static assert( hasAliasing!S12);
3301 static assert( hasAliasing!S13);
3302 static assert(!hasAliasing!S14);
3305 static assert( hasAliasing!S15);
3306 static assert(!hasAliasing!(immutable(S15)));
3308 static assert(!hasAliasing!noreturn);
3348 static assert( hasIndirections!(int[string]));
3349 static assert( hasIndirections!(void delegate()));
3350 static assert( hasIndirections!(void delegate() immutable));
3351 static assert( hasIndirections!(immutable(void delegate())));
3352 static assert( hasIndirections!(immutable(void delegate() immutable)));
3354 static assert(!hasIndirections!(void function()));
3355 static assert( hasIndirections!(void*[1]));
3356 static assert(!hasIndirections!(byte[1]));
3362 static assert( hasIndirections!(void[1]));
3390 static assert( hasIndirections!I);
3391 static assert(!hasIndirections!S1);
3392 static assert(!hasIndirections!S2);
3393 static assert(!hasIndirections!S3);
3394 static assert( hasIndirections!S4);
3395 static assert( hasIndirections!S5);
3396 static assert( hasIndirections!S6);
3397 static assert( hasIndirections!S7);
3398 static assert( hasIndirections!S8);
3399 static assert( hasIndirections!S9);
3400 static assert( hasIndirections!S10);
3401 static assert( hasIndirections!S12);
3402 static assert( hasIndirections!S13);
3403 static assert( hasIndirections!S14);
3404 static assert( hasIndirections!S15);
3405 static assert( hasIndirections!S16);
3406 static assert( hasIndirections!S17);
3407 static assert( hasIndirections!S18);
3408 static assert( hasIndirections!S19);
3409 static assert(!hasIndirections!S20);
3410 static assert(!hasIndirections!S21);
3411 static assert(!hasIndirections!S22);
3412 static assert( hasIndirections!S23);
3413 static assert( hasIndirections!S24);
3414 static assert( hasIndirections!S25);
3415 static assert( hasIndirections!S26);
3418 static assert(hasIndirections!HasContextPointer);
3420 static assert(!hasIndirections!noreturn);
3428 static assert(hasIndirections!T);
3459 static assert( hasUnsharedAliasing!S1);
3460 static assert(!hasUnsharedAliasing!S2);
3461 static assert(!hasUnsharedAliasing!S3);
3467 static assert(!hasUnsharedAliasing!S4);
3468 static assert( hasUnsharedAliasing!S5);
3469 static assert(!hasUnsharedAliasing!S6);
3470 static assert(!hasUnsharedAliasing!S7);
3478 static assert(!hasUnsharedAliasing!S8);
3480 static assert( hasUnsharedAliasing!(uint[uint]));
3482 static assert( hasUnsharedAliasing!(void delegate()));
3483 static assert( hasUnsharedAliasing!(void delegate() const));
3484 static assert(!hasUnsharedAliasing!(void delegate() immutable));
3485 static assert(!hasUnsharedAliasing!(void delegate() shared));
3486 static assert(!hasUnsharedAliasing!(void delegate() shared const));
3492 static assert( hasUnsharedAliasing!(const(void delegate())));
3493 static assert( hasUnsharedAliasing!(const(void delegate() const)));
3494 static assert(!hasUnsharedAliasing!(const(void delegate() immutable)));
3495 static assert(!hasUnsharedAliasing!(const(void delegate() shared)));
3496 static assert(!hasUnsharedAliasing!(const(void delegate() shared const)));
3497 static assert(!hasUnsharedAliasing!(immutable(void delegate())));
3498 static assert(!hasUnsharedAliasing!(immutable(void delegate() const)));
3499 static assert(!hasUnsharedAliasing!(immutable(void delegate() immutable)));
3500 static assert(!hasUnsharedAliasing!(immutable(void delegate() shared)));
3501 static assert(!hasUnsharedAliasing!(immutable(void delegate() shared const)));
3502 static assert(!hasUnsharedAliasing!(shared(void delegate())));
3503 static assert(!hasUnsharedAliasing!(shared(void delegate() const)));
3504 static assert(!hasUnsharedAliasing!(shared(void delegate() immutable)));
3505 static assert(!hasUnsharedAliasing!(shared(void delegate() shared)));
3506 static assert(!hasUnsharedAliasing!(shared(void delegate() shared const)));
3507 static assert(!hasUnsharedAliasing!(shared(const(void delegate()))));
3508 static assert(!hasUnsharedAliasing!(shared(const(void delegate() const))));
3509 static assert(!hasUnsharedAliasing!(shared(const(void delegate() immutable))));
3510 static assert(!hasUnsharedAliasing!(shared(const(void delegate() shared))));
3511 static assert(!hasUnsharedAliasing!(shared(const(void delegate() shared const))));
3512 static assert(!hasUnsharedAliasing!(void function()));
3515 static assert(hasUnsharedAliasing!I);
3517 static assert( hasUnsharedAliasing!(Rebindable!(const Object)));
3518 static assert(!hasUnsharedAliasing!(Rebindable!(immutable Object)));
3519 static assert(!hasUnsharedAliasing!(Rebindable!(shared Object)));
3520 static assert( hasUnsharedAliasing!(Rebindable!Object));
3523 static assert(!hasUnsharedAliasing!(int, shared(int)*));
3524 static assert( hasUnsharedAliasing!(int, int*));
3525 static assert( hasUnsharedAliasing!(int, const(int)[]));
3526 static assert( hasUnsharedAliasing!(int, shared(int)*, Rebindable!Object));
3527 static assert(!hasUnsharedAliasing!(shared(int)*, Rebindable!(shared Object)));
3528 static assert(!hasUnsharedAliasing!());
3555 static assert(!hasUnsharedAliasing!S9);
3556 static assert(!hasUnsharedAliasing!(immutable(S9)));
3557 static assert(!hasUnsharedAliasing!(shared(S9)));
3558 static assert( hasUnsharedAliasing!S10);
3559 static assert(!hasUnsharedAliasing!(immutable(S10)));
3560 static assert(!hasUnsharedAliasing!(shared(S10)));
3561 static assert( hasUnsharedAliasing!S11);
3562 static assert(!hasUnsharedAliasing!(immutable(S11)));
3563 static assert(!hasUnsharedAliasing!(shared(S11)));
3564 static assert( hasUnsharedAliasing!S12);
3565 static assert(!hasUnsharedAliasing!(immutable(S12)));
3566 static assert(!hasUnsharedAliasing!(shared(S12)));
3567 static assert( hasUnsharedAliasing!S13);
3568 static assert(!hasUnsharedAliasing!(immutable(S13)));
3569 static assert(!hasUnsharedAliasing!(shared(S13)));
3570 static assert( hasUnsharedAliasing!S14);
3571 static assert(!hasUnsharedAliasing!(immutable(S14)));
3572 static assert(!hasUnsharedAliasing!(shared(S14)));
3573 static assert( hasUnsharedAliasing!S15);
3574 static assert(!hasUnsharedAliasing!(immutable(S15)));
3575 static assert(!hasUnsharedAliasing!(shared(S15)));
3576 static assert( hasUnsharedAliasing!S16);
3577 static assert(!hasUnsharedAliasing!(immutable(S16)));
3578 static assert(!hasUnsharedAliasing!(shared(S16)));
3583 static assert(!hasUnsharedAliasing!S17);
3584 static assert( hasUnsharedAliasing!S18);
3585 static assert( hasUnsharedAliasing!S19);
3586 static assert(!hasUnsharedAliasing!S20);
3588 static assert(!hasUnsharedAliasing!noreturn);
3641 static assert(!hasElaborateCopyConstructor!int);
3650 static assert(!hasElaborateCopyConstructor!S1);
3651 static assert( hasElaborateCopyConstructor!S2);
3652 static assert( hasElaborateCopyConstructor!(immutable S2));
3653 static assert( hasElaborateCopyConstructor!S3);
3654 static assert( hasElaborateCopyConstructor!(S3[1]));
3655 static assert(!hasElaborateCopyConstructor!(S3[0]));
3656 static assert( hasElaborateCopyConstructor!S4);
3657 static assert(!hasElaborateCopyConstructor!S5);
3658 static assert(!hasElaborateCopyConstructor!S6);
3659 static assert( hasElaborateCopyConstructor!S7);
3698 static assert(!hasElaborateAssign!int);
3701 static assert( hasElaborateAssign!S);
3702 static assert(!hasElaborateAssign!(const(S)));
3707 static assert( hasElaborateAssign!S1);
3708 static assert(!hasElaborateAssign!S2);
3709 static assert( hasElaborateAssign!S3);
3710 static assert( hasElaborateAssign!(S3[1]));
3711 static assert(!hasElaborateAssign!(S3[0]));
3722 static assert( hasElaborateAssign!S4);
3729 static assert( hasElaborateAssign!S41);
3732 static assert( hasElaborateAssign!S5);
3739 static assert( hasElaborateAssign!S6);
3740 static assert(!hasElaborateAssign!S7);
3741 static assert(!hasElaborateAssign!S8);
3742 static assert( hasElaborateAssign!S9);
3743 static assert( hasElaborateAssign!S10);
3748 static assert( hasElaborateAssign!SS6);
3749 static assert(!hasElaborateAssign!SS7);
3750 static assert(!hasElaborateAssign!SS8);
3751 static assert( hasElaborateAssign!SS9);
3780 static assert(!hasElaborateDestructor!int);
3789 static assert(!hasElaborateDestructor!S1);
3790 static assert( hasElaborateDestructor!S2);
3791 static assert( hasElaborateDestructor!(immutable S2));
3792 static assert( hasElaborateDestructor!S3);
3793 static assert( hasElaborateDestructor!(S3[1]));
3794 static assert(!hasElaborateDestructor!(S3[0]));
3795 static assert( hasElaborateDestructor!S4);
3796 static assert(!hasElaborateDestructor!S5);
3797 static assert(!hasElaborateDestructor!S6);
3798 static assert( hasElaborateDestructor!S7);
3825 static assert(!hasElaborateMove!int);
3837 static assert(!hasElaborateMove!S1);
3838 static assert( hasElaborateMove!S2);
3839 static assert( hasElaborateMove!S3);
3840 static assert( hasElaborateMove!(immutable S3));
3841 static assert( hasElaborateMove!S4);
3842 static assert(!hasElaborateMove!S5);
3843 static assert(!hasElaborateMove!S6);
3844 static assert( hasElaborateMove!S7);
3845 static assert(!hasElaborateMove!S8);
3846 static assert(!hasElaborateMove!S9);
3847 static assert( hasElaborateMove!S10);
3861 static assert(!hasMember!(int, "blah"));
3866 static assert(hasMember!(S1, "blah"));
3867 static assert(hasMember!(S2, "blah"));
3868 static assert(hasMember!(C1, "blah"));
3869 static assert(hasMember!(C2, "blah"));
3890 static assert(hasMember!(S, "x"));
3891 static assert(hasMember!(S, "f"));
3892 static assert(hasMember!(S, "t"));
3893 static assert(hasMember!(S, "T"));
3894 static assert(hasMember!(R1!S, "x"));
3895 static assert(hasMember!(R1!S, "f"));
3896 static assert(hasMember!(R1!S, "t"));
3897 static assert(hasMember!(R1!S, "T"));
3898 static assert(hasMember!(R2!S, "x"));
3899 static assert(hasMember!(R2!S, "f"));
3900 static assert(hasMember!(R2!S, "t"));
3901 static assert(hasMember!(R2!S, "T"));
3910 static assert(hasMember!(S, "foo"));
3958 static assert( hasStaticMember!(S, "sf"));
3959 static assert(!hasStaticMember!(S, "f"));
3961 static assert( hasStaticMember!(S, "si"));
3962 static assert(!hasStaticMember!(S, "i"));
3964 static assert(!hasStaticMember!(S, "hello"));
4045 static assert(!hasStaticMember!(S, "na"));
4046 static assert(!hasStaticMember!(S, "X"));
4047 static assert(!hasStaticMember!(S, "Y"));
4048 static assert(!hasStaticMember!(S, "Y.i"));
4049 static assert(!hasStaticMember!(S, "S"));
4050 static assert(!hasStaticMember!(S, "C"));
4051 static assert( hasStaticMember!(S, "sx"));
4052 static assert( hasStaticMember!(S, "gx"));
4053 static assert(!hasStaticMember!(S, "y"));
4054 static assert( hasStaticMember!(S, "sy"));
4055 static assert( hasStaticMember!(S, "f"));
4056 static assert( hasStaticMember!(S, "f2"));
4057 static assert(!hasStaticMember!(S, "dm"));
4058 static assert( hasStaticMember!(S, "sd"));
4059 static assert(!hasStaticMember!(S, "g"));
4060 static assert( hasStaticMember!(S, "fp"));
4061 static assert( hasStaticMember!(S, "gfp"));
4062 static assert(!hasStaticMember!(S, "fpm"));
4063 static assert(!hasStaticMember!(S, "m"));
4064 static assert(!hasStaticMember!(S, "m2"));
4065 static assert(!hasStaticMember!(S, "iom"));
4066 static assert( hasStaticMember!(S, "iosf"));
4067 static assert(!hasStaticMember!(S, "p"));
4068 static assert( hasStaticMember!(S, "sp"));
4070 static assert(!hasStaticMember!(C, "na"));
4071 static assert(!hasStaticMember!(C, "X"));
4072 static assert(!hasStaticMember!(C, "Y"));
4073 static assert(!hasStaticMember!(C, "Y.i"));
4074 static assert(!hasStaticMember!(C, "S"));
4075 static assert(!hasStaticMember!(C, "C"));
4076 static assert( hasStaticMember!(C, "sx"));
4077 static assert( hasStaticMember!(C, "gx"));
4078 static assert(!hasStaticMember!(C, "y"));
4079 static assert( hasStaticMember!(C, "sy"));
4080 static assert( hasStaticMember!(C, "f"));
4081 static assert( hasStaticMember!(C, "f2"));
4082 static assert(!hasStaticMember!(C, "dm"));
4083 static assert( hasStaticMember!(C, "sd"));
4084 static assert(!hasStaticMember!(C, "g"));
4085 static assert( hasStaticMember!(C, "fp"));
4086 static assert( hasStaticMember!(C, "gfp"));
4087 static assert(!hasStaticMember!(C, "fpm"));
4088 static assert(!hasStaticMember!(C, "m"));
4089 static assert(!hasStaticMember!(C, "m2"));
4090 static assert(!hasStaticMember!(C, "iom"));
4091 static assert( hasStaticMember!(C, "iosf"));
4092 static assert(!hasStaticMember!(C, "p"));
4093 static assert( hasStaticMember!(C, "sp"));
4096 static assert(!hasStaticMember!(P, "na"));
4097 static assert(!hasStaticMember!(P, "X"));
4098 static assert(!hasStaticMember!(P, "Y"));
4099 static assert(!hasStaticMember!(P, "Y.i"));
4100 static assert(!hasStaticMember!(P, "S"));
4101 static assert(!hasStaticMember!(P, "C"));
4102 static assert( hasStaticMember!(P, "sx"));
4103 static assert( hasStaticMember!(P, "gx"));
4104 static assert(!hasStaticMember!(P, "y"));
4105 static assert( hasStaticMember!(P, "sy"));
4106 static assert( hasStaticMember!(P, "f"));
4107 static assert( hasStaticMember!(P, "f2"));
4108 static assert(!hasStaticMember!(P, "dm"));
4109 static assert( hasStaticMember!(P, "sd"));
4110 static assert(!hasStaticMember!(P, "g"));
4111 static assert( hasStaticMember!(P, "fp"));
4112 static assert( hasStaticMember!(P, "gfp"));
4113 static assert(!hasStaticMember!(P, "fpm"));
4114 static assert(!hasStaticMember!(P, "m"));
4115 static assert(!hasStaticMember!(P, "m2"));
4116 static assert(!hasStaticMember!(P, "iom"));
4117 static assert( hasStaticMember!(P, "iosf"));
4118 static assert(!hasStaticMember!(P, "p"));
4119 static assert( hasStaticMember!(P, "sp"));
4169 assert(sqrts == [Sqrts.one, Sqrts.two, Sqrts.three]);
4187 assert(0, "Not an enum member");
4196 assert(rank(Mode.read) == 0);
4197 assert(rank(Mode.write) == 1);
4198 assert(rank(Mode.map) == 2);
4231 assert(fooObj.calledMethod == "bar");
4237 static assert([ EnumMembers!A ] == [ A.a ]);
4239 static assert([ EnumMembers!B ] == [ B.a, B.b, B.c, B.d, B.e ]);
4245 static assert([ EnumMembers!A ] == [ A.a, A.b ]);
4253 static assert([ EnumMembers!B ] == [ B.a, B.b, B.c ]);
4263 static assert([ EnumMembers!A ] == [ A.a, A.b, A.c, A.d, A.e ]);
4288 static assert(EnumMembers!TLAs[0] == TLAs._0000);
4289 static assert(EnumMembers!TLAs[$-1] == TLAs._2999);
4295 static assert(__traits(identifier, EnumMembers!E[0]) == "member");
4296 static assert(__traits(identifier, EnumMembers!E[1]) == "a");
4297 static assert(__traits(identifier, EnumMembers!E[2]) == "b");
4315 static assert(0, "argument is not a class or interface");
4326 static assert(is(BaseTypeTuple!I12 == AliasSeq!(I1, I2)));
4330 static assert(is(BaseTypeTuple!I123 == AliasSeq!(I1, I2, I3)));
4341 assert(TL.length == 3);
4342 assert(is (TL[0] == A));
4343 assert(is (TL[1] == I1));
4344 assert(is (TL[2] == I2));
4346 assert(BaseTypeTuple!Object.length == 0);
4385 static assert(!BaseClassesTuple!Object.length);
4386 static assert(is(BaseClassesTuple!C1 == AliasSeq!(Object)));
4387 static assert(is(BaseClassesTuple!C2 == AliasSeq!(C1, Object)));
4388 static assert(is(BaseClassesTuple!C3 == AliasSeq!(C2, C1, Object)));
4410 static assert(!__traits(compiles, BaseClassesTuple!S));
4412 static assert(!__traits(compiles, BaseClassesTuple!I));
4415 static assert(is(BaseClassesTuple!C5 == AliasSeq!(C4, Object)));
4463 static assert(is(TL[0] == I1) && is(TL[1] == I2));
4478 static assert(is(InterfacesTuple!I ==
4480 static assert(is(InterfacesTuple!C2 ==
4502 assert(TL.length == 5);
4503 assert(is (TL[0] == B2));
4504 assert(is (TL[1] == B1));
4505 assert(is (TL[2] == Object));
4506 assert(is (TL[3] == J1));
4507 assert(is (TL[4] == J2));
4509 assert(TransitiveBaseTypeTuple!Object.length == 0);
4633 static assert(foos.length == 2);
4634 static assert(__traits(isSame, foos[0], C.foo));
4635 static assert(__traits(isSame, foos[1], B.foo));
4654 assert(__traits(isSame, fs[0], bfs[0]) || __traits(isSame, fs[0], bfs[1]));
4655 assert(__traits(isSame, fs[1], bfs[0]) || __traits(isSame, fs[1], bfs[1]));
4684 assert(test_ctor.length == 4);
4686 assert(test_dtor.length == 1);
4688 assert(test2_ctor.length == 1);
4690 assert(test2_dtor.length == 1);
4709 static assert(test.length == 2);
4710 static assert(is(FunctionTypeOf!(test[0]) == FunctionTypeOf!(C.test)));
4711 static assert(is(FunctionTypeOf!(test[1]) == FunctionTypeOf!(K.test)));
4713 static assert(noexist.length == 0);
4717 static assert(prop.length == 1);
4727 static assert(Test_foo.length == 3);
4728 static assert(is(typeof(&Test_foo[0]) == void function()));
4729 static assert(is(typeof(&Test_foo[2]) == void function(int)));
4730 static assert(is(typeof(&Test_foo[1]) == void function(int, int)));
4750 static assert(__traits(isSame, TemplateOf!(Foo!(int, real)), Foo));
4765 static assert(__traits(isSame, TemplateOf!(Foo1!(int)), Foo1));
4766 static assert(__traits(isSame, TemplateOf!(Foo2!(int, int)), Foo2));
4767 static assert(__traits(isSame, TemplateOf!(Foo3!(123)), Foo3));
4768 static assert(__traits(isSame, TemplateOf!(Foo4!("123")), Foo4));
4769 static assert(__traits(isSame, TemplateOf!(Foo5!(int)), Foo5));
4770 static assert(__traits(isSame, TemplateOf!(Foo6!(int, int)), Foo6));
4771 static assert(__traits(isSame, TemplateOf!(Foo7!(123)), Foo7));
4772 static assert(__traits(isSame, TemplateOf!(Foo8!(int).Foo9!(real)), Foo8!(int).Foo9));
4773 static assert(__traits(isSame, TemplateOf!(Foo10!()), Foo10));
4779 static assert(is(TemplateOf!(int[]) == void));
4780 static assert(is(TemplateOf!bool == void));
4797 static assert(is(TemplateArgsOf!(Foo!(int, real)) == AliasSeq!(int, real)));
4814 static assert(is(TemplateArgsOf!(Foo1!(int)) == AliasSeq!(int)));
4815 static assert(is(TemplateArgsOf!(Foo2!(int, int)) == AliasSeq!(int, int)));
4816 static assert(__traits(isSame, TemplateArgsOf!(Foo3!(x)), AliasSeq!(x)));
4817 static assert(TemplateArgsOf!(Foo4!(y)) == AliasSeq!(y));
4818 static assert(is(TemplateArgsOf!(Foo5!(int)) == AliasSeq!(int)));
4819 static assert(is(TemplateArgsOf!(Foo6!(int, int)) == AliasSeq!(int, int)));
4820 static assert(__traits(isSame, TemplateArgsOf!(Foo7!(x)), AliasSeq!(x)));
4821 static assert(is(TemplateArgsOf!(Foo8!(int).Foo9!(real)) == AliasSeq!(real)));
4822 static assert(is(TemplateArgsOf!(Foo10!()) == AliasSeq!()));
4851 static assert(classInstanceAlignment!A == (void*).alignof);
4852 static assert(classInstanceAlignment!B == long.alignof);
4880 assert(is(X == long));
4882 assert(is(Y == void));
4888 static assert(is(CommonType!(3) == int));
4889 static assert(is(CommonType!(double, 4, float) == double));
4890 static assert(is(CommonType!(string, char[]) == const(char)[]));
4891 static assert(is(CommonType!(3, 3U) == uint));
4892 static assert(is(CommonType!(double, int) == double));
4983 static assert(is(AllImplicitConversionTargets!(ulong) == AliasSeq!(long, float, double, real)));
4984 …static assert(is(AllImplicitConversionTargets!(int) == AliasSeq!(dchar, uint, long, ulong, float, …
4985 static assert(is(AllImplicitConversionTargets!(float) == AliasSeq!(double, real)));
4986 static assert(is(AllImplicitConversionTargets!(double) == AliasSeq!(float, real)));
4988 static assert(is(AllImplicitConversionTargets!(char) ==
4992 static assert(is(AllImplicitConversionTargets!(wchar) == AliasSeq!(
4995 static assert(is(AllImplicitConversionTargets!(dchar) == AliasSeq!(
4999 static assert(is(AllImplicitConversionTargets!(string) == AliasSeq!(const(char)[])));
5000 static assert(is(AllImplicitConversionTargets!(int*) == AliasSeq!(void*)));
5006 static assert(is(AllImplicitConversionTargets!(C) == AliasSeq!(Object, A, B)));
5007 …static assert(is(AllImplicitConversionTargets!(const C) == AliasSeq!(const Object, const A, const …
5008 static assert(is(AllImplicitConversionTargets!(immutable C) == AliasSeq!(
5014 static assert(is(AllImplicitConversionTargets!(I) == AliasSeq!(A, B)));
5015 static assert(is(AllImplicitConversionTargets!(const I) == AliasSeq!(const A, const B)));
5016 static assert(is(AllImplicitConversionTargets!(immutable I) == AliasSeq!(
5023 static assert(is(AllImplicitConversionTargets!(double)[0] == float));
5024 static assert(is(AllImplicitConversionTargets!(double)[1] == real));
5025 static assert(is(AllImplicitConversionTargets!(string)[0] == const(char)[]));
5130 static assert(is(ImplicitConversionTargets!(ulong) == AliasSeq!(float, double, real)));
5131 … static assert(is(ImplicitConversionTargets!(int) == AliasSeq!(long, ulong, float, double, real)));
5132 static assert(is(ImplicitConversionTargets!(float) == AliasSeq!(double, real)));
5133 static assert(is(ImplicitConversionTargets!(double) == AliasSeq!(real)));
5135 static assert(is(ImplicitConversionTargets!(char) == AliasSeq!(
5138 static assert(is(ImplicitConversionTargets!(wchar) == AliasSeq!(
5141 static assert(is(ImplicitConversionTargets!(dchar) == AliasSeq!(
5145 static assert(is(ImplicitConversionTargets!(string) == AliasSeq!(const(char)[])));
5146 static assert(is(ImplicitConversionTargets!(void*) == AliasSeq!(void*)));
5152 static assert(is(ImplicitConversionTargets!(C) == AliasSeq!(Object, A, B)));
5153 …static assert(is(ImplicitConversionTargets!(const C) == AliasSeq!(const Object, const A, const B))…
5154 static assert(is(ImplicitConversionTargets!(immutable C) == AliasSeq!(
5161 static assert(is(ImplicitConversionTargets!(double)[0] == real));
5162 static assert(is(ImplicitConversionTargets!(string)[0] == const(char)[]));
5173 static assert( isImplicitlyConvertible!(immutable(char), char));
5174 static assert( isImplicitlyConvertible!(const(char), char));
5175 static assert( isImplicitlyConvertible!(char, wchar));
5176 static assert(!isImplicitlyConvertible!(wchar, char));
5178 static assert(!isImplicitlyConvertible!(const(ushort), ubyte));
5179 static assert(!isImplicitlyConvertible!(const(uint), ubyte));
5180 static assert(!isImplicitlyConvertible!(const(ulong), ubyte));
5182 static assert(!isImplicitlyConvertible!(const(char)[], string));
5183 static assert( isImplicitlyConvertible!(string, const(char)[]));
5199 static assert( isAssignable!(long, int));
5200 static assert(!isAssignable!(int, long));
5201 static assert( isAssignable!(const(char)[], string));
5202 static assert(!isAssignable!(string, char[]));
5205 static assert( isAssignable!int);
5208 static assert(!isAssignable!(immutable int));
5230 static assert( isRvalueAssignable!(long, int));
5231 static assert(!isRvalueAssignable!(int, long));
5232 static assert( isRvalueAssignable!S1);
5233 static assert(!isRvalueAssignable!S2);
5255 static assert( isLvalueAssignable!(long, int));
5256 static assert(!isLvalueAssignable!(int, long));
5257 static assert( isLvalueAssignable!S1);
5258 static assert( isLvalueAssignable!S2);
5263 static assert(!isAssignable!(immutable int, int));
5264 static assert( isAssignable!(int, immutable int));
5266 static assert(!isAssignable!(inout int, int));
5267 static assert( isAssignable!(int, inout int));
5268 static assert(!isAssignable!(inout int));
5270 static assert( isAssignable!(shared int, int));
5271 static assert( isAssignable!(int, shared int));
5272 static assert( isAssignable!(shared int));
5274 static assert( isAssignable!(void[1], void[1]));
5277 static assert( isAssignable!(S, S));
5280 static assert( isAssignable!(S2, S2));
5281 static assert(!isAssignable!(S2, int));
5284 static assert( isAssignable!(S3, S3));
5287 static assert(!isAssignable!(S3X, S3X));
5290 static assert( isAssignable!(S4, S4));
5291 static assert( isAssignable!(S4, int));
5292 static assert( isAssignable!(S4, immutable int));
5296 static assert(!isAssignable!S5);
5303 static assert(isRvalueAssignable!(S6, S5));
5304 static assert(isLvalueAssignable!(S6, S5));
5305 static assert(isAssignable!(S6, S5));
5306 static assert(isAssignable!(S6, immutable S5));
5312 static assert(!isRvalueAssignable!(S6, S5));
5313 static assert( isLvalueAssignable!(S6, S5));
5314 static assert(!isAssignable!(S6, S5));
5315 static assert( isLvalueAssignable!(S6, immutable S5));
5368 static assert( isBlitAssignable!int);
5369 static assert(!isBlitAssignable!(const int));
5372 static assert( isBlitAssignable!C);
5376 static assert( isBlitAssignable!S1);
5377 static assert(!isBlitAssignable!S2);
5382 static assert( isBlitAssignable!(S3X));
5383 static assert( isBlitAssignable!(S3Y));
5384 static assert(!isBlitAssignable!(S3Z));
5385 static assert(!isBlitAssignable!(const S3X));
5386 static assert(!isBlitAssignable!(inout S3Y));
5387 static assert(!isBlitAssignable!(immutable S3Z));
5388 static assert( isBlitAssignable!(S3X[3]));
5389 static assert( isBlitAssignable!(S3Y[3]));
5390 static assert(!isBlitAssignable!(S3Z[3]));
5394 static assert( isBlitAssignable!(ES3X));
5395 static assert( isBlitAssignable!(ES3Y));
5396 static assert(!isBlitAssignable!(ES3Z));
5397 static assert(!isBlitAssignable!(const ES3X));
5398 static assert(!isBlitAssignable!(inout ES3Y));
5399 static assert(!isBlitAssignable!(immutable ES3Z));
5400 static assert( isBlitAssignable!(ES3X[3]));
5401 static assert( isBlitAssignable!(ES3Y[3]));
5402 static assert(!isBlitAssignable!(ES3Z[3]));
5407 static assert( isBlitAssignable!(U1X));
5408 static assert( isBlitAssignable!(U1Y));
5409 static assert(!isBlitAssignable!(U1Z));
5410 static assert(!isBlitAssignable!(const U1X));
5411 static assert(!isBlitAssignable!(inout U1Y));
5412 static assert(!isBlitAssignable!(immutable U1Z));
5413 static assert( isBlitAssignable!(U1X[3]));
5414 static assert( isBlitAssignable!(U1Y[3]));
5415 static assert(!isBlitAssignable!(U1Z[3]));
5419 static assert( isBlitAssignable!(EU1X));
5420 static assert( isBlitAssignable!(EU1Y));
5421 static assert(!isBlitAssignable!(EU1Z));
5422 static assert(!isBlitAssignable!(const EU1X));
5423 static assert(!isBlitAssignable!(inout EU1Y));
5424 static assert(!isBlitAssignable!(immutable EU1Z));
5425 static assert( isBlitAssignable!(EU1X[3]));
5426 static assert( isBlitAssignable!(EU1Y[3]));
5427 static assert(!isBlitAssignable!(EU1Z[3]));
5435 static assert(!isStaticArray!SA);
5436 static assert(!isBlitAssignable!(SA[3]));
5455 static assert( isStorageClassImplicitlyConvertible!( int, const int));
5456 static assert( isStorageClassImplicitlyConvertible!(immutable int, const int));
5458 static assert(!isStorageClassImplicitlyConvertible!(const int, int));
5459 static assert(!isStorageClassImplicitlyConvertible!(const int, immutable int));
5460 static assert(!isStorageClassImplicitlyConvertible!(int, shared int));
5461 static assert(!isStorageClassImplicitlyConvertible!(shared int, int));
5594 static assert(isCovariantWith!(typeof(C.clone), typeof(I.clone)));
5598 static assert(!isCovariantWith!(typeof(C.clone), typeof(J.clone)));
5611 static assert( isCovariantWith!(DerivA_1.test, BaseA.test));
5612 static assert( isCovariantWith!(DerivA_2.test, BaseA.test));
5613 static assert(!isCovariantWith!(BaseA.test, DerivA_1.test));
5614 static assert(!isCovariantWith!(BaseA.test, DerivA_2.test));
5615 static assert( isCovariantWith!(BaseA.test, BaseA.test));
5616 static assert( isCovariantWith!(DerivA_1.test, DerivA_1.test));
5617 static assert( isCovariantWith!(DerivA_2.test, DerivA_2.test));
5624 static assert(.isCovariantWith!(typeof(derived_function), typeof(base_function)));
5625 static assert(.isCovariantWith!(typeof(*derived_function), typeof(*base_function)));
5626 static assert(.isCovariantWith!(typeof(derived_delegate), typeof(base_delegate)));
5633 static assert( isCovariantWith!(DerivB_1.test, BaseB.test));
5634 static assert( isCovariantWith!(DerivB_2.test, BaseB.test));
5635 static assert( isCovariantWith!(DerivB_3.test, BaseB.test));
5636 static assert(!isCovariantWith!(BaseB.test, DerivB_1.test));
5637 static assert(!isCovariantWith!(BaseB.test, DerivB_2.test));
5638 static assert(!isCovariantWith!(BaseB.test, DerivB_3.test));
5643 static assert( isCovariantWith!(DerivC_1.test, BaseC.test));
5644 static assert(!isCovariantWith!(BaseC.test, DerivC_1.test));
5650 static assert( isCovariantWith!(DerivE_1.test, BaseE.test));
5651 static assert( isCovariantWith!(DerivE_2.test, BaseE.test));
5652 static assert(!isCovariantWith!(BaseE.test, DerivE_1.test));
5653 static assert(!isCovariantWith!(BaseE.test, DerivE_2.test));
5666 static assert( isCovariantWith!(DerivF.test1, BaseF.test1));
5667 static assert( isCovariantWith!(DerivF.test2, BaseF.test2));
5696 static assert(is(typeof(f(rvalueOf!int)) == int));
5703 static assert(is(typeof(f(lvalueOf!int)) == bool));
5714 static assert(!__traits(compiles, needLvalue(rvalueOf!T)));
5715 static assert( __traits(compiles, needLvalue(lvalueOf!T)));
5716 static assert(is(typeof(rvalueOf!T) == T));
5717 static assert(is(typeof(lvalueOf!T) == T));
5720 static assert(!__traits(compiles, rvalueOf!int = 1));
5721 static assert( __traits(compiles, lvalueOf!byte = 127));
5722 static assert(!__traits(compiles, lvalueOf!byte = 128));
5744 static assert(0, T.stringof~" is not boolean type");
5753 static assert( is(Q!T == BooleanTypeOf!( Q!T )));
5754 static assert( is(Q!T == BooleanTypeOf!( SubTypeOf!(Q!T) )));
5760 static assert(!is(BooleanTypeOf!( Q!T )), Q!T.stringof);
5761 static assert(!is(BooleanTypeOf!( SubTypeOf!(Q!T) )));
5777 static assert(is(BooleanTypeOf!B == bool));
5778 static assert(is(BooleanTypeOf!S == bool));
5796 static assert(0, T.stringof~" is not an integral type");
5804 static assert( is(Q!T == IntegralTypeOf!( Q!T )));
5805 static assert( is(Q!T == IntegralTypeOf!( SubTypeOf!(Q!T) )));
5812 static assert(!is(IntegralTypeOf!( Q!T )));
5813 static assert(!is(IntegralTypeOf!( SubTypeOf!(Q!T) )));
5831 static assert(0, T.stringof~" is not a floating point type");
5839 static assert( is(Q!T == FloatingPointTypeOf!( Q!T )));
5840 static assert( is(Q!T == FloatingPointTypeOf!( SubTypeOf!(Q!T) )));
5846 static assert(!is(FloatingPointTypeOf!( Q!T )));
5847 static assert(!is(FloatingPointTypeOf!( SubTypeOf!(Q!T) )));
5860 static assert(0, T.stringof~" is not a numeric type");
5868 static assert( is(Q!T == NumericTypeOf!( Q!T )));
5869 static assert( is(Q!T == NumericTypeOf!( SubTypeOf!(Q!T) )));
5875 static assert(!is(NumericTypeOf!( Q!T )));
5876 static assert(!is(NumericTypeOf!( SubTypeOf!(Q!T) )));
5887 static assert(0, T.stringof~" is not an unsigned type.");
5899 static assert(0, T.stringof~" is not an signed type.");
5916 static assert(0, T.stringof~" is not a character type");
5924 static assert( is(CharTypeOf!( Q!T )));
5925 static assert( is(CharTypeOf!( SubTypeOf!(Q!T) )));
5931 static assert(!is(CharTypeOf!( Q!T )));
5932 static assert(!is(CharTypeOf!( SubTypeOf!(Q!T) )));
5938 static assert(!is(CharTypeOf!( Q!T )));
5939 static assert(!is(CharTypeOf!( SubTypeOf!(Q!T) )));
5955 static assert(0, T.stringof~" is not a static array type");
5963 static assert(is( Q!( T[1] ) == StaticArrayTypeOf!( Q!( T[1] ) ) ));
5967 static assert(is( Q!(P!(T[1])) == StaticArrayTypeOf!( Q!(SubTypeOf!(P!(T[1]))) ) ));
5974 static assert(is( StaticArrayTypeOf!( Q!(void[1]) ) == Q!(void[1]) ));
5992 static assert(is( Q!T[] == DynamicArrayTypeOf!( Q!T[] ) ));
5993 static assert(is( Q!(T[]) == DynamicArrayTypeOf!( Q!(T[]) ) ));
5997 static assert(is( Q!(P!T[]) == DynamicArrayTypeOf!( Q!(SubTypeOf!(P!T[])) ) ));
5998 static assert(is( Q!(P!(T[])) == DynamicArrayTypeOf!( Q!(SubTypeOf!(P!(T[]))) ) ));
6002 static assert(!is(DynamicArrayTypeOf!(int[3])));
6003 static assert(!is(DynamicArrayTypeOf!(void[3])));
6004 static assert(!is(DynamicArrayTypeOf!(typeof(null))));
6016 static assert(0, T.stringof~" is not an array type");
6042 static assert(0, T.stringof~" is not a string type");
6049 static assert(0);
6052 static assert(0, T.stringof~" is not a string type");
6061 static assert(is(Q!T[] == StringTypeOf!( Q!T[] )));
6065 static assert(is(Q!T[] == StringTypeOf!( SubTypeOf!(Q!T[]) )));
6069 static assert(is(StringTypeOf!(C!Str) == Str));
6076 static assert(!is(StringTypeOf!( Q!T[] )));
6082 static assert(is(StringTypeOf!(char[4]) == char[]));
6096 static assert(is(StringTypeOf!S == string));
6097 static assert(is(StringTypeOf!T == string));
6114 static assert(0, T.stringof~" is not an associative array type");
6124 … static assert(is( P!(Q!T[R!T]) == AssocArrayTypeOf!( P!(Q!T[R!T]) ) ));
6133 … static assert(is( O!(P!(Q!T[R!T])) == AssocArrayTypeOf!( O!(SubTypeOf!(P!(Q!T[R!T]))) ) ));
6154 static assert(0);
6170 static assert( isBoolean!bool);
6172 static assert( isBoolean!EB);
6179 static assert(!isBoolean!(SubTypeOfBool));
6189 static assert(!isIntegral!(S!bool));
6210 static assert(
6219 static assert(
6232 static assert(!isIntegral!S);
6241 static assert( isIntegral!(Q!T));
6242 static assert(!isIntegral!(SubTypeOf!(Q!T)));
6246 static assert(!isIntegral!float);
6251 static assert(isIntegral!EU && isUnsigned!EU && !isSigned!EU);
6252 static assert(isIntegral!EI && !isUnsigned!EI && isSigned!EI);
6263 static assert(
6271 static assert(!isFloatingPoint!int);
6280 static assert(!isFloatingPoint!S);
6291 static assert( isFloatingPoint!(Q!T));
6292 static assert(!isFloatingPoint!(SubTypeOf!(Q!T)));
6299 static assert(!isFloatingPoint!(Q!T));
6304 static assert(!isFloatingPoint!(__vector(float[4])));
6328 static assert(
6340 static assert(
6355 static assert(!isNumeric!S);
6364 static assert( isNumeric!(Q!T));
6365 static assert(!isNumeric!(SubTypeOf!(Q!T)));
6374 static assert(!isNumeric!(S!int));
6377 static assert(!isNumeric!EChar);
6381 static assert(!isNumeric!(__vector(float[4])));
6385 static assert(!isNumeric!(__vector(int[4])));
6388 static assert(!isNumeric!ifloat);
6389 static assert(!isNumeric!cfloat);
6401 static assert(!isScalarType!void);
6402 static assert( isScalarType!(immutable(byte)));
6403 static assert( isScalarType!(immutable(ushort)));
6404 static assert( isScalarType!(immutable(int)));
6405 static assert( isScalarType!(ulong));
6406 static assert( isScalarType!(shared(float)));
6407 static assert( isScalarType!(shared(const bool)));
6408 static assert( isScalarType!(const(char)));
6409 static assert( isScalarType!(wchar));
6410 static assert( isScalarType!(const(dchar)));
6411 static assert( isScalarType!(const(double)));
6412 static assert( isScalarType!(const(real)));
6422 static assert(!isScalarType!(S!int));
6433 static assert(isBasicType!void);
6434 static assert(isBasicType!(const(void)));
6435 static assert(isBasicType!(shared(void)));
6436 static assert(isBasicType!(immutable(void)));
6437 static assert(isBasicType!(shared const(void)));
6438 static assert(isBasicType!(shared inout(void)));
6439 static assert(isBasicType!(shared inout const(void)));
6440 static assert(isBasicType!(inout(void)));
6441 static assert(isBasicType!(inout const(void)));
6442 static assert(isBasicType!(immutable(int)));
6443 static assert(isBasicType!(shared(float)));
6444 static assert(isBasicType!(shared(const bool)));
6445 static assert(isBasicType!(const(dchar)));
6465 static assert(
6470 static assert(
6486 static assert( isUnsigned!(Q!T));
6487 static assert(!isUnsigned!(SubTypeOf!(Q!T)));
6496 static assert(!isUnsigned!(S!uint));
6499 static assert(!isUnsigned!EChar);
6503 static assert(!isUnsigned!(__vector(uint[4])));
6516 static assert(
6521 static assert(
6530 static assert(isSigned!E);
6533 static assert(!isSigned!Eubyte);
6539 static assert( isSigned!(Q!T));
6540 static assert(!isSigned!(SubTypeOf!(Q!T)));
6549 static assert(!isSigned!(S!uint));
6553 static assert(!isSigned!(__vector(int[4])));
6556 static assert(!isSigned!ifloat);
6557 static assert(!isSigned!cfloat);
6563 static assert(isUnsigned!bool == false);
6564 static assert(isSigned!bool == false);
6587 static assert( isSomeChar!char);
6588 static assert( isSomeChar!wchar);
6589 static assert( isSomeChar!dchar);
6590 static assert( isSomeChar!(typeof('c')));
6591 static assert( isSomeChar!(immutable char));
6592 static assert( isSomeChar!(const dchar));
6595 static assert(!isSomeChar!int);
6596 static assert(!isSomeChar!byte);
6597 static assert(!isSomeChar!string);
6598 static assert(!isSomeChar!wstring);
6599 static assert(!isSomeChar!dstring);
6600 static assert(!isSomeChar!(char[4]));
6611 static assert( isSomeChar!( Q!T ));
6612 static assert(!isSomeChar!( SubTypeOf!(Q!T) ));
6622 static assert(!isSomeChar!(S!char));
6640 static assert( isSomeString!string);
6641 static assert( isSomeString!(wchar[]));
6642 static assert( isSomeString!(dchar[]));
6643 static assert( isSomeString!(typeof("aaa")));
6644 static assert( isSomeString!(const(char)[]));
6647 static assert(!isSomeString!int);
6648 static assert(!isSomeString!(int[]));
6649 static assert(!isSomeString!(byte[]));
6650 static assert(!isSomeString!(typeof(null)));
6651 static assert(!isSomeString!(char[4]));
6654 static assert(!isSomeString!ES);
6661 static assert(!isSomeString!Stringish);
6668 static assert( isSomeString!( T ));
6669 static assert(!isSomeString!(SubTypeOf!(T)));
6672 static assert(!isSomeString!(C[]));
6686 static assert(isNarrowString!string);
6687 static assert(isNarrowString!wstring);
6688 static assert(isNarrowString!(char[]));
6689 static assert(isNarrowString!(wchar[]));
6691 static assert(!isNarrowString!dstring);
6692 static assert(!isNarrowString!(dchar[]));
6694 static assert(!isNarrowString!(typeof(null)));
6695 static assert(!isNarrowString!(char[4]));
6698 static assert(!isNarrowString!ES);
6705 static assert(!isNarrowString!Stringish);
6715 static assert( isNarrowString!( Q!T ));
6716 static assert(!isNarrowString!( SubTypeOf!(Q!T) ));
6724 static assert(!isNarrowString!( Q!T ));
6725 static assert(!isNarrowString!( SubTypeOf!(Q!T) ));
6729 static assert(!isNarrowString!(C[]));
6741 static assert(isOrderingComparable!int);
6742 static assert(isOrderingComparable!string);
6745 static assert(!isOrderingComparable!Foo);
6755 assert(isOrderingComparable!Bar && b2 > b1);
6763 static assert(isEqualityComparable!int);
6764 static assert(isEqualityComparable!string);
6765 static assert(!isEqualityComparable!void);
6768 static assert(isEqualityComparable!Foo);
6779 static assert(isEqualityComparable!Bar);
6780 assert(b1 == b2);
6781 assert(b1 != b3);
6825 assert(!isConvertibleToString!string);
6826 assert(isConvertibleToString!AliasedString);
6827 assert(isConvertibleToString!StringEnum);
6828 assert(isConvertibleToString!(char[25]));
6829 assert(!isConvertibleToString!(char[]));
6837 assert(!isConvertibleToString!I);
6838 assert(isConvertibleToString!S);
6893 static assert(isAutodecodableString!wstring);
6894 static assert(isAutodecodableString!Stringish);
6895 static assert(!isAutodecodableString!dstring);
6901 static assert(isAutodecodableString!(char[]));
6902 static assert(!isAutodecodableString!(E));
6903 static assert(isAutodecodableString!(F));
6904 static assert(isAutodecodableString!(G));
6915 static assert(isAutodecodableString!(H));
6916 static assert(isAutodecodableString!(I));
6918 static assert(!isAutodecodableString!(noreturn[]));
6919 static assert(!isAutodecodableString!(immutable(noreturn)[]));
6930 static assert( isStaticArray!(int[3]));
6931 static assert( isStaticArray!(const(int)[5]));
6932 static assert( isStaticArray!(const(int)[][5]));
6934 static assert(!isStaticArray!(const(int)[]));
6935 static assert(!isStaticArray!(immutable(int)[]));
6936 static assert(!isStaticArray!(const(int)[4][]));
6937 static assert(!isStaticArray!(int[]));
6938 static assert(!isStaticArray!(int[char]));
6939 static assert(!isStaticArray!(int[1][]));
6940 static assert(!isStaticArray!(int[int]));
6941 static assert(!isStaticArray!int);
6952 static assert( isStaticArray!( Q!T ));
6953 static assert(!isStaticArray!( SubTypeOf!(Q!T) ));
6981 static assert( isDynamicArray!(int[]));
6982 static assert( isDynamicArray!(string));
6983 static assert( isDynamicArray!(long[3][]));
6985 static assert(!isDynamicArray!(int[5]));
6986 static assert(!isDynamicArray!(typeof(null)));
6996 static assert( isDynamicArray!( Q!T ));
6997 static assert(!isDynamicArray!( SubTypeOf!(Q!T) ));
7001 static assert(!isDynamicArray!(int[5]));
7009 static assert(!isDynamicArray!AliasThis);
7017 static assert( isDynamicArray!E);
7029 static assert( isArray!(int[]));
7030 static assert( isArray!(int[5]));
7031 static assert( isArray!(string));
7033 static assert(!isArray!uint);
7034 static assert(!isArray!(uint[uint]));
7035 static assert(!isArray!(typeof(null)));
7045 static assert( isArray!(Q!T));
7046 static assert(!isArray!(SubTypeOf!(Q!T)));
7061 static assert( isAssociativeArray!(int[string]));
7062 static assert( isAssociativeArray!(S[S]));
7063 static assert(!isAssociativeArray!(string[]));
7064 static assert(!isAssociativeArray!S);
7065 static assert(!isAssociativeArray!(int[4]));
7080 static assert( isAssociativeArray!(Q!T));
7081 static assert(!isAssociativeArray!(SubTypeOf!(Q!T)));
7085 static assert(!isAssociativeArray!Foo);
7086 static assert(!isAssociativeArray!int);
7087 static assert(!isAssociativeArray!(int[]));
7088 static assert(!isAssociativeArray!(typeof(null)));
7107 static assert( isBuiltinType!void);
7108 static assert( isBuiltinType!string);
7109 static assert( isBuiltinType!(int[]));
7110 static assert( isBuiltinType!(C[string]));
7111 static assert( isBuiltinType!(typeof(null)));
7112 static assert(!isBuiltinType!C);
7113 static assert(!isBuiltinType!U);
7114 static assert(!isBuiltinType!S);
7115 static assert(!isBuiltinType!I);
7116 static assert(!isBuiltinType!(void delegate(int)));
7130 static assert(isSIMDVector!(__vector(float[4])));
7131 static assert(isSIMDVector!SimdVec);
7133 static assert(!isSIMDVector!uint);
7134 static assert(!isSIMDVector!(float[4]));
7147 static assert( isPointer!(int*));
7148 static assert( isPointer!(int function()));
7149 static assert(!isPointer!int);
7150 static assert(!isPointer!string);
7151 static assert(!isPointer!(typeof(null)));
7152 static assert(!isPointer!(typeof(fun)));
7153 static assert(!isPointer!(int delegate()));
7162 static assert( isPointer!(Q!T));
7163 static assert(!isPointer!(SubTypeOf!(Q!T)));
7167 static assert(!isPointer!uint);
7168 static assert(!isPointer!(uint[uint]));
7169 static assert(!isPointer!(char[]));
7170 static assert(!isPointer!(typeof(null)));
7181 static assert(is(PointerTarget!(int*) == int));
7182 static assert(is(PointerTarget!(void*) == void));
7199 static assert( isAggregateType!C);
7200 static assert( isAggregateType!U);
7201 static assert( isAggregateType!S);
7202 static assert( isAggregateType!I);
7203 static assert(!isAggregateType!void);
7204 static assert(!isAggregateType!string);
7205 static assert(!isAggregateType!(int[]));
7206 static assert(!isAggregateType!(C[string]));
7207 static assert(!isAggregateType!(void delegate(int)));
7224 int opApply(scope int delegate(ref uint) dg) { assert(0); }
7229 @property uint front() { assert(0); }
7230 void popFront() { assert(0); }
7234 static assert( isIterable!(uint[]));
7235 static assert( isIterable!OpApply);
7236 static assert( isIterable!(uint[string]));
7237 static assert( isIterable!Range);
7239 static assert(!isIterable!uint);
7251 static assert( isMutable!int);
7252 static assert( isMutable!string);
7253 static assert( isMutable!(shared int));
7254 static assert( isMutable!(shared const(int)[]));
7256 static assert(!isMutable!(const int));
7257 static assert(!isMutable!(inout int));
7258 static assert(!isMutable!(shared(const int)));
7259 static assert(!isMutable!(shared(inout int)));
7260 static assert(!isMutable!(immutable string));
7285 static assert(isInstanceOf!(Foo, Foo!int));
7286 static assert(!isInstanceOf!(Foo, Bar!int));
7287 static assert(!isInstanceOf!(Foo, int));
7288 static assert(isInstanceOf!(Doo, Doo!int));
7289 static assert(isInstanceOf!(ABC, ABC!1));
7290 static assert(!isInstanceOf!(Foo, Foo));
7291 static assert(isInstanceOf!(fun, fun!int));
7292 static assert(isInstanceOf!(templ, templ!int));
7314 static assert(!__traits(compiles, a1.func(a3)));
7315 static assert( __traits(compiles, a1.method(a2)));
7316 static assert( __traits(compiles, a1.method(a3)));
7326 static assert(!isInstanceOf!(fun1, fun2!int));
7327 static assert(!isInstanceOf!(templ1, templ2!int));
7355 static assert(isExpressions!(1, 2.0, "a"));
7356 static assert(!isExpressions!(int, double, string));
7357 static assert(!isExpressions!(int, 2.0, "a"));
7373 static assert( isExpressionTuple!(42));
7374 static assert( isExpressionTuple!aa);
7375 static assert( isExpressionTuple!("cattywampus", 2.7, aa));
7376 static assert( isExpressionTuple!(bar()));
7378 static assert(!isExpressionTuple!isExpressionTuple);
7379 static assert(!isExpressionTuple!foo);
7380 static assert(!isExpressionTuple!( (a) { } ));
7381 static assert(!isExpressionTuple!int);
7382 static assert(!isExpressionTuple!myint);
7404 static assert(isTypeTuple!(int, float, string));
7405 static assert(!isTypeTuple!(1, 2.0, "a"));
7406 static assert(!isTypeTuple!(1, double, string));
7416 static assert( isTypeTuple!int);
7417 static assert( isTypeTuple!string);
7418 static assert( isTypeTuple!C);
7419 static assert( isTypeTuple!(typeof(func)));
7420 static assert( isTypeTuple!(int, char, double));
7422 static assert(!isTypeTuple!c);
7423 static assert(!isTypeTuple!isTypeTuple);
7424 static assert(!isTypeTuple!CONST);
7440 static assert( isFunctionPointer!fpfoo);
7441 static assert( isFunctionPointer!(void function()));
7444 static assert(!isFunctionPointer!dgbar);
7445 static assert(!isFunctionPointer!(void delegate()));
7446 static assert(!isFunctionPointer!foo);
7447 static assert(!isFunctionPointer!bar);
7449 static assert( isFunctionPointer!((int a) {}));
7465 assert(isDelegate!dg);
7466 assert(isDelegate!(int delegate()));
7467 assert(isDelegate!(typeof(&func)));
7470 assert(!isDelegate!fp);
7471 assert(!isDelegate!(int function()));
7472 assert(!isDelegate!(typeof(&sfunc)));
7517 static assert( isSomeFunction!func);
7518 static assert( isSomeFunction!prop);
7519 static assert( isSomeFunction!(C.method));
7520 static assert( isSomeFunction!(C.prop));
7521 static assert( isSomeFunction!(c.prop));
7522 static assert( isSomeFunction!(c.prop));
7523 static assert( isSomeFunction!fp);
7524 static assert( isSomeFunction!dg);
7526 static assert(!isSomeFunction!int);
7527 static assert(!isSomeFunction!val);
7534 static assert(isSomeFunction!nestedFunc);
7535 static assert(isSomeFunction!nestedProp);
7536 static assert(isSomeFunction!(real function(ref int)));
7537 static assert(isSomeFunction!(real delegate(ref int)));
7538 static assert(isSomeFunction!((int a) { return a; }));
7539 static assert(!isSomeFunction!isSomeFunction);
7576 static assert( isCallable!f);
7577 static assert( isCallable!g);
7584 static assert( isCallable!c);
7585 static assert( isCallable!(c.opCall));
7586 static assert( isCallable!S);
7587 static assert( isCallable!(I.value));
7588 static assert( isCallable!((int a) { return a; }));
7590 static assert(!isCallable!I);
7601 static assert( isCallable!f);
7602 static assert( isCallable!g);
7603 static assert( isCallable!S1);
7604 static assert( isCallable!S2);
7619 static assert(isCallable!(Wrapper.f));
7620 static assert(isCallable!(Wrapper.g));
7640 static assert(!isAbstractFunction!(int));
7641 static assert(!isAbstractFunction!(S.foo));
7642 static assert(!isAbstractFunction!(C.foo));
7643 static assert( isAbstractFunction!(AC.foo));
7661 static assert(!isFinalFunction!(int));
7662 static assert(!isFinalFunction!(S.bar));
7663 static assert( isFinalFunction!(FC.foo));
7664 static assert(!isFinalFunction!(C.bar));
7665 static assert( isFinalFunction!(C.foo));
7690 static assert(isNestedFunction!(f));
7693 static assert(!isNestedFunction!f);
7710 static assert(!isNestedFunction!(Outer.Inner));
7711 static assert(!isNestedFunction!(SS));
7725 static assert(!isAbstractClass!S);
7726 static assert(!isAbstractClass!C);
7727 static assert( isAbstractClass!AC);
7729 static assert(!isAbstractClass!c);
7731 static assert( isAbstractClass!ac);
7746 static assert(!isFinalClass!C);
7747 static assert(!isFinalClass!AC);
7748 static assert( isFinalClass!FC1);
7749 static assert( isFinalClass!FC2);
7751 static assert(!isFinalClass!c);
7753 static assert( isFinalClass!fc1);
7780 static assert(is(Unconst!int == int));
7781 static assert(is(Unconst!(const int) == int));
7782 static assert(is(Unconst!(immutable int) == int));
7783 static assert(is(Unconst!(shared int) == shared int));
7784 static assert(is(Unconst!(shared(const int)) == shared int));
7789 static assert(is(Unconst!( int) == int));
7790 static assert(is(Unconst!( const int) == int));
7791 static assert(is(Unconst!( inout int) == int));
7792 static assert(is(Unconst!( inout const int) == int));
7793 static assert(is(Unconst!(shared int) == shared int));
7794 static assert(is(Unconst!(shared const int) == shared int));
7795 static assert(is(Unconst!(shared inout int) == shared int));
7796 static assert(is(Unconst!(shared inout const int) == shared int));
7797 static assert(is(Unconst!( immutable int) == int));
7800 static assert(is(Unconst!ImmIntArr == immutable(int)[]));
7823 static assert(is(Unqual!int == int));
7824 static assert(is(Unqual!(const int) == int));
7825 static assert(is(Unqual!(immutable int) == int));
7826 static assert(is(Unqual!(shared int) == int));
7827 static assert(is(Unqual!(shared(const int)) == int));
7832 static assert(is(Unqual!( int) == int));
7833 static assert(is(Unqual!( const int) == int));
7834 static assert(is(Unqual!( inout int) == int));
7835 static assert(is(Unqual!( inout const int) == int));
7836 static assert(is(Unqual!(shared int) == int));
7837 static assert(is(Unqual!(shared const int) == int));
7838 static assert(is(Unqual!(shared inout int) == int));
7839 static assert(is(Unqual!(shared inout const int) == int));
7840 static assert(is(Unqual!( immutable int) == int));
7843 static assert(is(Unqual!ImmIntArr == immutable(int)[]));
7873 static assert(is(CopyTypeQualifiers!(inout const real, int) == inout const int));
7878 static assert(is(CopyTypeQualifiers!( real, int) == int));
7879 static assert(is(CopyTypeQualifiers!( const real, int) == const int));
7880 static assert(is(CopyTypeQualifiers!( inout real, int) == inout int));
7881 static assert(is(CopyTypeQualifiers!( inout const real, int) == inout const int));
7882 static assert(is(CopyTypeQualifiers!(shared real, int) == shared int));
7883 static assert(is(CopyTypeQualifiers!(shared const real, int) == shared const int));
7884 static assert(is(CopyTypeQualifiers!(shared inout real, int) == shared inout int));
7885 static assert(is(CopyTypeQualifiers!(shared inout const real, int) == shared inout const int));
7886 static assert(is(CopyTypeQualifiers!( immutable real, int) == immutable int));
7907 assert( is(typeof(f) == const float));
7910 assert( is(typeof(u) == uint));
7913 assert(!is(CopyConstness!(shared bool, int) == shared int));
7916 assert( is(CopyConstness!(shared const real, double) == const double));
7920 assert(!is(MutT == const(int)));
7924 assert( is(CstT == const(int)));
7936 assert(is(CopyConstness!(typeof(Test.method1), real) == real));
7938 assert(is(CopyConstness!(typeof(Test.method2), byte) == const(byte)));
7940 assert(is(CopyConstness!(typeof(Test.method3), string) == immutable(string)));
7945 assert(is(CopyConstness!(inout(int)[], int[]) == int[]));
7946 assert(is(CopyConstness!(inout(int[]), int[]) == inout(int[])));
7951 static assert(is(CopyConstness!( int, real) == real));
7952 static assert(is(CopyConstness!(const int, real) == const real));
7953 static assert(is(CopyConstness!(inout int, real) == inout real));
7954 static assert(is(CopyConstness!(inout const int, real) == inout const real));
7955 static assert(is(CopyConstness!(shared int, real) == real));
7956 static assert(is(CopyConstness!(shared const int, real) == const real));
7957 static assert(is(CopyConstness!(shared inout int, real) == inout real));
7958 static assert(is(CopyConstness!(shared inout const int, real) == inout const real));
7959 static assert(is(CopyConstness!(immutable int, real) == immutable real));
7978 assert(0);
7985 static assert(is(ForeachType!(uint[]) == uint));
7986 static assert(is(ForeachType!string == immutable(char)));
7987 static assert(is(ForeachType!(string[string]) == string));
7988 static assert(is(ForeachType!(inout(int)[]) == inout(int)));
8007 static assert(is(OriginalType!E == real));
8008 static assert(is(OriginalType!F == real));
8009 static assert(is(OriginalType!G == const real));
8021 static assert(is(KeyType!Hash == string));
8022 static assert(is(ValueType!Hash == int));
8036 static assert(is(KeyType!Hash == string));
8037 static assert(is(ValueType!Hash == int));
8069 static assert(false, "Type " ~ T.stringof ~
8079 static assert(is(Unsigned!(int) == uint));
8080 static assert(is(Unsigned!(long) == ulong));
8081 static assert(is(Unsigned!(const short) == const ushort));
8082 static assert(is(Unsigned!(immutable byte) == immutable ubyte));
8083 static assert(is(Unsigned!(inout int) == inout uint));
8090 static assert(is(Unsigned!(uint) == uint));
8091 static assert(is(Unsigned!(const uint) == const uint));
8093 static assert(is(Unsigned!(ubyte) == ubyte));
8094 static assert(is(Unsigned!(immutable uint) == immutable uint));
8102 static assert(is(U1 == uint));
8103 static assert(is(U2 == const(uint)));
8104 static assert(is(U3 == immutable(uint)));
8109 static assert(is(UV1 == __vector(uint[4])));
8110 static assert(is(UV2 == const(__vector(uint[4]))));
8120 static assert(is(U4 == ucent));
8121 static assert(is(U5 == const(ucent)));
8122 static assert(is(U6 == immutable(ucent)));
8142 static assert(is(Largest!(uint, ubyte, ushort, real) == real));
8143 static assert(is(Largest!(ulong, double) == ulong));
8144 static assert(is(Largest!(double, ulong) == double));
8145 static assert(is(Largest!(uint, byte, double, short) == double));
8147 static assert(is(Largest!(uint, ubyte, ucent, ushort) == ucent));
8171 static assert(false, "Type " ~ T.stringof ~
8182 static assert(is(S1 == int));
8184 static assert(is(S2 == const(int)));
8186 static assert(is(S3 == immutable(int)));
8190 static assert(is(S4 == cent));
8196 static assert(is(Signed!float == float));
8201 static assert(is(SV1 == __vector(int[4])));
8202 static assert(is(SV2 == const(__vector(int[4]))));
8224 static assert(mostNegative!float == -float.max);
8225 static assert(mostNegative!double == -double.max);
8226 static assert(mostNegative!real == -real.max);
8227 static assert(mostNegative!bool == false);
8236 static assert(mostNegative!T == T.min);
8239 static assert(mostNegative!T == 0);
8256 static assert(is(typeof(a * b) == Promoted!ubyte));
8257 static assert(is(Promoted!ubyte == int));
8259 static assert(is(Promoted!(shared(bool)) == shared(int)));
8260 static assert(is(Promoted!(const(int)) == const(int)));
8261 static assert(is(Promoted!double == double));
8269 static assert(is(Promoted!T == int));
8270 static assert(is(Promoted!(shared(const T)) == shared(const int)));
8276 static assert(is(Promoted!T == T));
8277 static assert(is(Promoted!(immutable(T)) == immutable(T)));
8299 static assert(TL == AliasSeq!("i", "xi", "yi"));
8307 static assert(mangledName!int == int.mangleof);
8308 static assert(mangledName!C == C.mangleof);
8309 static assert(mangledName!(C.value) == C.value.mangleof);
8310 static assert(mangledName!(C.value)[$ - 12 .. $] == "5valueMFNdZi");
8311 static assert(mangledName!mangledName == "3std6traits11mangledName");
8312 static assert(mangledName!freeFunc == "_D3std6traits8freeFuncFAyaZv");
8316 …static assert(mangledName!((int a) { return a+x; }) == "DFNaNbNiNfiZi"); // pure nothrow @safe @n…
8318 static assert(mangledName!((int a) { return a+x; }) == "DFNbNiNfiZi"); // nothrow @safe @nnogc
8328 assert(foo_demangled[0 .. 4] == "int " && foo_demangled[$-3 .. $] == "foo",
8333 assert(bar_demangled[0 .. 5] == "void " && bar_demangled[$-5 .. $] == "bar()");
8355 static assert(is(Select!(true, int, long) == int));
8356 static assert(is(Select!(false, int, long) == long));
8358 static assert(is(Select!(false, const(int), const(Foo)) == const(Foo)));
8365 assert(selA == 1);
8366 assert(selB == 2);
8370 static assert(val == 3);
8393 int fail() { assert(0); }
8396 static assert(is(typeof(a) == real));
8397 static assert(is(typeof(b) == real));
8416 static assert(hasUDA!(a, "alpha"));
8417 static assert(!hasUDA!(a, S));
8418 static assert(!hasUDA!(a, E));
8421 static assert(!hasUDA!(b, "alpha"));
8422 static assert(!hasUDA!(b, S));
8423 static assert(hasUDA!(b, E));
8426 static assert(!hasUDA!(c, "alpha"));
8427 static assert(!hasUDA!(c, S));
8428 static assert(hasUDA!(c, E));
8431 static assert(!hasUDA!(d, "alpha"));
8432 static assert(hasUDA!(d, S));
8433 static assert(hasUDA!(d, E));
8436 static assert(!hasUDA!(e, "alpha"));
8437 static assert(hasUDA!(e, S));
8438 static assert(!hasUDA!(e, S()));
8439 static assert(!hasUDA!(e, E));
8442 static assert(!hasUDA!(f, "alpha"));
8443 static assert(hasUDA!(f, S));
8444 static assert(hasUDA!(f, S()));
8445 static assert(!hasUDA!(f, E));
8448 static assert(hasUDA!(g, "alpha"));
8449 static assert(hasUDA!(g, S));
8450 static assert(hasUDA!(g, E));
8453 static assert(hasUDA!(h, 100));
8458 static assert(hasUDA!(i, Named));
8459 static assert(hasUDA!(i, Named("abc")));
8460 static assert(!hasUDA!(i, Named("def")));
8469 static assert(hasUDA!(j, AttrT));
8470 static assert(hasUDA!(j, AttrT!int));
8471 static assert(!hasUDA!(j, AttrT!string));
8474 static assert(hasUDA!(k, AttrT));
8475 static assert(!hasUDA!(k, AttrT!int));
8476 static assert(hasUDA!(k, AttrT!string));
8483 static assert(hasUDA!(l, FuncAttr));
8484 static assert(!hasUDA!(l, FuncAttr!fourtyTwo));
8485 static assert(hasUDA!(l, FuncAttr!getLen));
8486 static assert(!hasUDA!(l, FuncAttr!fourtyTwo()));
8487 static assert(!hasUDA!(l, FuncAttr!getLen()));
8490 static assert(hasUDA!(m, FuncAttr));
8491 static assert(!hasUDA!(m, FuncAttr!fourtyTwo));
8492 static assert(hasUDA!(m, FuncAttr!getLen));
8493 static assert(!hasUDA!(m, FuncAttr!fourtyTwo()));
8494 static assert(hasUDA!(m, FuncAttr!getLen()));
8526 static assert(getUDAs!(a, Attr).length == 1);
8527 static assert(getUDAs!(a, Attr)[0].name == "Answer");
8528 static assert(getUDAs!(a, Attr)[0].value == 42);
8531 static assert(getUDAs!(b, Attr).length == 1);
8532 static assert(getUDAs!(b, Attr)[0].name == "Answer");
8533 static assert(getUDAs!(b, Attr)[0].value == 42);
8536 static assert(getUDAs!(c, Attr).length == 2);
8537 static assert(getUDAs!(c, Attr)[0].name == "Answer");
8538 static assert(getUDAs!(c, Attr)[0].value == 42);
8539 static assert(getUDAs!(c, Attr)[1].name == "Pi");
8540 static assert(getUDAs!(c, Attr)[1].value == 3);
8542 static assert(getUDAs!(c, Attr("Answer", 42)).length == 1);
8543 static assert(getUDAs!(c, Attr("Answer", 42))[0].name == "Answer");
8544 static assert(getUDAs!(c, Attr("Answer", 42))[0].value == 42);
8546 static assert(getUDAs!(c, Attr("Answer", 99)).length == 0);
8555 static assert(getUDAs!(d, AttrT).length == 2);
8556 static assert(getUDAs!(d, AttrT)[0].name == "Answer");
8557 static assert(getUDAs!(d, AttrT)[0].value == 42);
8558 static assert(getUDAs!(d, AttrT)[1].name == "Pi");
8559 static assert(getUDAs!(d, AttrT)[1].value == 3);
8561 static assert(getUDAs!(d, AttrT!uint).length == 1);
8562 static assert(getUDAs!(d, AttrT!uint)[0].name == "Answer");
8563 static assert(getUDAs!(d, AttrT!uint)[0].value == 42);
8565 static assert(getUDAs!(d, AttrT!int).length == 1);
8566 static assert(getUDAs!(d, AttrT!int)[0].name == "Pi");
8567 static assert(getUDAs!(d, AttrT!int)[0].value == 3);
8572 static assert(getUDAs!(e, SimpleAttr).length == 1);
8573 static assert(is(getUDAs!(e, SimpleAttr)[0] == SimpleAttr));
8576 static assert(getUDAs!(f, SimpleAttr).length == 1);
8577 static assert(is(typeof(getUDAs!(f, SimpleAttr)[0]) == SimpleAttr));
8584 static assert(getUDAs!(g, FuncAttr).length == 1);
8585 static assert(getUDAs!(g, FuncAttr)[0].func(5) == 47);
8587 static assert(getUDAs!(g, FuncAttr!add42).length == 1);
8588 static assert(getUDAs!(g, FuncAttr!add42)[0].func(5) == 47);
8590 static assert(getUDAs!(g, FuncAttr!add42()).length == 0);
8592 static assert(getUDAs!(g, FuncAttr!concat).length == 0);
8593 static assert(getUDAs!(g, FuncAttr!concat()).length == 0);
8596 static assert(getUDAs!(h, FuncAttr).length == 1);
8597 static assert(getUDAs!(h, FuncAttr)[0].func(5) == 47);
8599 static assert(getUDAs!(h, FuncAttr!add42).length == 1);
8600 static assert(getUDAs!(h, FuncAttr!add42)[0].func(5) == 47);
8602 static assert(getUDAs!(h, FuncAttr!add42()).length == 1);
8603 static assert(getUDAs!(h, FuncAttr!add42())[0].func(5) == 47);
8605 static assert(getUDAs!(h, FuncAttr!concat).length == 0);
8606 static assert(getUDAs!(h, FuncAttr!concat()).length == 0);
8609 static assert(getUDAs!(i, "alpha").length == 1);
8610 static assert(getUDAs!(i, "alpha")[0] == "alpha");
8612 static assert(getUDAs!(i, 42).length == 1);
8613 static assert(getUDAs!(i, 42)[0] == 42);
8615 static assert(getUDAs!(i, 'c').length == 0);
8676 static assert(getSymbolsByUDA!(A, Attr).length == 1);
8677 static assert(hasUDA!(getSymbolsByUDA!(A, Attr)[0], Attr));
8700 static assert(getSymbolsByUDA!(A, Attr).length == 2);
8702 static assert(hasUDA!(getSymbolsByUDA!(A, Attr)[0], Attr));
8703 static assert(hasUDA!(getSymbolsByUDA!(A, Attr)[1], Attr));
8722 static assert(getSymbolsByUDA!(B, UDA).length == 2);
8724 static assert(getSymbolsByUDA!(B, 100).length == 1);
8726 static assert(getUDAs!(getSymbolsByUDA!(B, UDA)[0], UDA)[0].name == "X");
8741 static assert(getSymbolsByUDA!(C, UDA).length == 2);
8742 static assert(getSymbolsByUDA!(C, UDA)[0].stringof == "C");
8743 static assert(getSymbolsByUDA!(C, UDA)[1].stringof == "d");
8756 static assert(getSymbolsByUDA!(D, UDA).length == 0);
8778 static assert(getSymbolsByUDA!(A, attr1).length == 2);
8779 static assert(getSymbolsByUDA!(A, attr2).length == 1);
8794 static assert(hasUDA!(getSymbolsByUDA!(HasPrivateMembers, Attr)[0], Attr));
8808 static assert(res.length == 1);
8809 static assert(res[0].stringof == "a");
8821 static assert(is(getSymbolsByUDA!(X, X) == AliasSeq!()));
8837 static assert(getSymbolsByUDA!(A, Attr).stringof == "tuple(a, a, c)");
8846 static assert(__traits(compiles, getSymbolsByUDA!(mixin(__MODULE__), "Issue20054")));
8908 static assert(allSameType!());
8909 static assert(allSameType!(int));
8910 static assert(allSameType!(int, int));
8911 static assert(allSameType!(int, int, int));
8912 static assert(allSameType!(float, float, float));
8913 static assert(!allSameType!(int, double));
8914 static assert(!allSameType!(int, float, double));
8915 static assert(!allSameType!(int, float, double, real));
8916 static assert(!allSameType!(short, int, float, double, real));
8935 static assert( ifTestable!bool);
8936 static assert( ifTestable!int);
8937 static assert( ifTestable!(S1*));
8938 static assert( ifTestable!(typeof(null)));
8939 static assert( ifTestable!(int[]));
8940 static assert( ifTestable!(int[string]));
8941 static assert( ifTestable!S2);
8942 static assert( ifTestable!C);
8943 static assert(!ifTestable!S1);
8949 static assert(allSatisfy!(ifTestable, AliasSeq!(bool, int, float, double, string)));
8951 static assert(!ifTestable!(bool, a => BoolWrapper(a)));
8972 static assert(isType!int);
8973 static assert(isType!string);
8974 static assert(isType!(int[int]));
8975 static assert(isType!S);
8976 static assert(isType!C);
8977 static assert(isType!I);
8978 static assert(isType!U);
8982 static assert(!isType!n);
8983 static assert(!isType!func);
8984 static assert(!isType!(S.Test));
8985 static assert(!isType!(S.Test!()));
9022 static assert(isFunction!func);
9028 static assert(isFunction!(S.func));
9058 static assert(!isFinal!(C));
9059 static assert( isFinal!(FC));
9061 static assert(!isFinal!(C.nf));
9062 static assert(!isFinal!(C.sf));
9063 static assert( isFinal!(C.ff));
9089 static assert( isCopyable!S1);
9090 static assert( isCopyable!S2);
9091 static assert(!isCopyable!S3);
9092 static assert(!isCopyable!S4);
9094 static assert(isCopyable!C1);
9095 static assert(isCopyable!int);
9096 static assert(isCopyable!(int[]));
9117 static assert(is(DeducedParameterType!(const(int)) == const(int)));
9118 static assert(is(DeducedParameterType!(const(int[2])) == const(int[2])));
9120 static assert(is(DeducedParameterType!(const(int*)) == const(int)*));
9121 static assert(is(DeducedParameterType!(const(int[])) == const(int)[]));
9131 static assert(is(DeducedParameterType!NoCopy == NoCopy));
9136 static assert(is(DeducedParameterType!(inout(int[])) == inout(int)[]));