-removed string_intern

-removed unused traits
This commit is contained in:
Mergul 2019-04-06 14:15:02 +00:00
parent 201681e4ca
commit 77f67004dd
2 changed files with 2 additions and 166 deletions

View file

@ -1,28 +1,7 @@
module ecs.traits;
module ecs.traits;
import std.traits;
bool isForeachDelegateWithI(DG)() {
return is(DG == delegate) && is(ReturnType!DG == int)
&& Parameters!DG.length == 2 && isIntegral!(Parameters!(DG)[0]);
}
unittest {
assert(isForeachDelegateWithI!(int delegate(int, double)));
assert(isForeachDelegateWithI!(int delegate(int, double) @nogc nothrow));
assert(!isForeachDelegateWithI!(int delegate(double, double)));
}
bool isForeachDelegateWithoutI(DG)() {
return is(DG == delegate) && is(ReturnType!DG == int) && Parameters!DG.length == 1;
}
unittest {
assert(isForeachDelegateWithoutI!(int delegate(int)));
assert(isForeachDelegateWithoutI!(int delegate(size_t) @nogc nothrow));
assert(!isForeachDelegateWithoutI!(void delegate(int)));
}
bool isForeachDelegateWithTypes(DG, Types...)() {
return is(DG == delegate) && is(ReturnType!DG == int) && is(Parameters!DG == Types);
}
@ -31,9 +10,4 @@ unittest {
assert(isForeachDelegateWithTypes!(int delegate(int, int), int, int));
assert(isForeachDelegateWithTypes!(int delegate(ref int, ref int), int, int));
assert(!isForeachDelegateWithTypes!(int delegate(double), int, int));
}
auto assumeNoGC(T)(T t) if (isFunctionPointer!T || isDelegate!T) {
enum attrs = functionAttributes!T | FunctionAttribute.nogc;
return cast(SetFunctionAttributes!(T, functionLinkage!T, attrs)) t;
}
}