I have a templated function wrapper with template type equal to return type of the function. Further the function's first argument is a pointer to the wrapper itself.
template<typename R>
struct wrapper_t{
using result_t = R;
template<typename F, typename ...Ts>
wrapper_t(F &&, Ts &&...){
}
};
int foo(wrapper_t<int>*,double){
return 2;
}
I'm trying to use user-defined deduction guides here in order to avoid specifying the template type such that I can use it like
wrapper_t wrapper(foo,1.0);
But I don't know with what I should replace the question marks in the following guide with, because of the recursion.
template<typename F, typename ...Ts>
wrapper_t(F &&, Ts &&...)->wrapper_t<std::invoke_result_t<F,/*???*/,Ts...>>;
Is ctad still doable here, if so how?