In the following class, wrapper takes a pointer to an arbitrary const method and returns the result of a call to that method with const re
You can perfect forward the arguments to the function:
template
auto& wrapper(T const& (C::*f)(Ts...) const, Args&&... args) {
return const_cast((this->*f)(std::forward(args)...));
}
This is achieved by making args a forwarding reference parameter pack. Note that we need to introduce a new Args template parameter pack in order to deduce the arguments correctly.