Is it possible to infer the return type of a templated member function in a CRTP base class?
While inferring argument types works well, it fails wit
An extra indirection is your friend:
template struct f_impl_result { typedef decltype(static_cast(0)->f_impl(std::declval())) type; }; template struct base { template auto f(T x) -> typename f_impl_result::type { return static_cast(*this).f_impl(x); } };