I want to call a lambda and pass the parameters separately.
e.g.:
#include <memory>
template<typename T, typename... TS>
T call(T (*)(TS...) f, TS&&... args) {
return f(std::forward<TS...>(args...));
}
Thus I want to call this function like this:
call([](auto arg1, auto arg2){
std::cout << arg1 << ", " << arg2 << std::endl;
}, 1, 2);
This should print out 1, 2
.