Capture the args in a temporary tuple (Live at Coliru):
ReturnType operator()(Args... args)
{
static_assert(sizeof...(args) >= 3, "Uh-oh, too few args.");
// Capture args in a tuple
auto&& t = std::forward_as_tuple(args...);
// Get argument 0
std::cout << std::get<0>(t) << '\n';
// Get argument 1
std::cout << std::get<1>(t) << '\n';
// Get argument 2
std::cout << std::get<2>(t) << '\n';
}
std::forward_as_tuple
uses perfect forwarding to capture references to the args
, so there should be no copying.