MSVC 2012 の右辺値参照で問題が発生しました。
#include <thread>
#include <string>
#include <future>
void foo(std::promise<std::string> &&prms) { /* some code */ }
int main() {
std::promise<std::string> prms;
// std::future<std::string> ftr = prms.get_future();
std::thread th(&foo, std::move(prms));
// some other code
}
コンパイラのメッセージ:エラー C2664: 'void (std::promise<_Ty> &&)' : パラメーター 1 を 'std::promise<_Ty>' から 'std::promise<_Ty> &&' に変換できません
私の間違い(それを修正する方法)またはコンパイラの問題(そのような動作の起源を知りたい)はありますか?