1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | template<typename Obj, typename ...Args> struct holder { template<void(Obj::*mem_fn)(Args...)> struct thing { }; }; class A { public: void method(int x, int y); }; template<typename Obj, typename ...Args> holder<Obj,Args...> create_env(void(Obj::*fun)(Args...)); int main() { using env = decltype(create_env(&A::method)); using in_two = env::thing<&A::method>; using in_one = decltype(create_env(&A::method))::template thing<&A::method>; }; |