std::async using an rvalue reference bound to a lambda
问题 I'm trying to bind an rvalue reference to a lambda using std::bind , but I have issues when I throw that into a std::async call: (source) auto lambda = [] (std::string&& message) { std::cout << message << std::endl; }; auto bound = std::bind(lambda, std::string{"hello world"}); auto future = std::async(bound); // Compiler error here future.get() This issues a compiler error I'm not really sure how to interpret: error: no type named 'type' in 'class std::result_of(std::basic_string)>&()>' What