Consider:
template <typename Function, typename ...Args>
auto wrapper(Function&& f, Args&&... args) -> decltype(f(args...)) {
//...
}
Is there a way to partially specialize the above template for all the cases where decltype(f(args...)) is a pointer?
EDIT:
I think it can be done with an template helper class which takes decltype(f(args...)) as template argument, and specialize the helper class. If you know better solutions let me know.
An SFINAE-based solution:
You can adapt the test (here,
std::is_pointer<Result>) to your needs.