请考虑:
template <typename Function, typename ...Args>
auto wrapper(Function&& f, Args&&... args) -> decltype(f(args...)) {
//...
}
有没有一种方法可以部分专门化上面的模板,以涵盖所有decltype(f(args...))
是指针的情况?
编辑:
我认为可以通过一个模板助手类来实现,该类以decltype(f(args...))
作为模板参数,并专门化助手类。如果您知道更好的解决方案,请告诉我。