Is it possible to store a function that has similar behaviour to the following function:
void target(int foo, size_t bar) {}
void target(std::string foo, int bar) {}
template<T...>
void forwarding_func(T&&... args)
{
target(std::forward<T>(args)...);
}
auto forwarding_callable = ?
How would one build the callable object for types T that has the same behaviour as the forwarding_func. I have to store it for later use, so I do need a std::function object? Is it possible to even store lambdas like these in function objects?
auto f = [](auto&& x){
myfunction(std::forward<decltype(x)>(x));
}