Hi,
I would like to suggest the addition of the following function to custom_class_detail.h:
template <typename R, typename CurrClass, typename... Args>
struct WrapMethod<R (CurrClass::*)(Args...) const noexcept> {
WrapMethod(R (CurrClass::*m)(Args...) const noexcept) : m(std::move(m)) {}
R operator()(c10::intrusive_ptr<CurrClass> cur, Args... args) {
return std::invoke(m, *cur, args...);
}
R (CurrClass::*m)(Args...) const;
};
Without the above specialization, I ran into the following error using g+±13 with –std=c++17 option:
error: invalid use of incomplete type ‘struct torch::detail::WrapMethod<void (MyClass::*)() const noexcept>’
110 | return WrapMethod<Func>(std::move(f));