std::bind with variadic template and auto return type
问题 Following the code in this question, I have a std::bind with a variadic template function. If I try to provide a function template with auto return, gcc rejects the program: #include <functional> template <typename... Args auto inv_impl(Args... a) { return (a + ...); } template <typename... Args> auto inv(Args... args) { auto bound = std::bind(&inv_impl<Args...>, args...); return bound; } int main() { auto b = inv(1, 2); } The compile error is: foo.cc: In instantiation of ‘auto inv(Args ...)