Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MethodSignature {
- string name;
- void* ptr;
- }
- class MethodSignatureImp(string Name, alias Method) : MethodSignature {
- this() {
- this.name = Name;
- this.ptr = (cast(void function())addressOf!Method);
- }
- }
- private template addressOf(alias A) {
- enum addressOf = &A;
- }
- ///=========== called like
- foreach (o; __traits(getOverloads, T, member)) {
- static if (!is(ReturnType!(typeof(&o)) U == inout U) && !is(ReturnType!(typeof(&o)) U == inout U[]) && !__traits(isStaticFunction, o)) {
- static if (o.mangleof.length > T.mangleof.length && T.mangleof[1 .. $] == o.mangleof[2 .. T.mangleof.length + 1]) {
- pragma(msg, " - " ~ o.mangleof[T.mangleof.length + 1 .. $]);
- //auto a = &(__traits(getOverloads, T, member)[0]);
- ret ~= new MethodSignatureImp!(o.mangleof[T.mangleof.length + 1 .. $], o);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement