back soft

مطالب مرتبط با «class dynamics definition» در back soft | نویسنده: استخدام کار

Extract a typedef/using definition from a template class

Vote count: 1 Is there a way to extract a typedef from a template class? For example, this is what I would like to do: template class Foo{ public: typedef T(*Functor)(Args...); Foo() = default; }; template Foo make_foo(T(*f)(Args...)){ retu Foo; } int bar(int i){ retu i * 2; } using type = make_foo(bar)::Functor; I caot do this. However, I can do this: using type = Foo::Functor; This sort of defeats the purpose for me. Is there any way to wrap a function such that I can extract it in type form? ...

ادامه مطلب