저는 최근에 Visual Studio 11 Developer Preview를 설치했습니다. 스레드 및 선물을 가지고 노는 동안이 설치를 둘러 보았습니다.VS 11 with std :: future - 버그입니까?
#include <future>
#include <iostream>
int foo(unsigned a, unsigned b)
{
return 5;
}
int main()
{
std::future<int> f = std::async(foo, 5, 7);
std::cout << f.get();
}
매우 간단합니다. 그러나 "foo"에 대한 두 가지 인수가 있기 때문에 VS 11은 컴파일하려고하지 않습니다. (단, g의 ++을 수행합니다 http://ideone.com/ANrPj)을 (런타임 오류는 문제가되지 않습니다 : std::future exception on gcc experimental implementation of C++0x) (VS 11으로 ErrorMessage : http://pastebin.com/F9Xunh2s)이 오류가 나에게 매우 분명 보이기 때문에, 지금 나는 혼란 조금 해요
, 심지어 경우 개발자 미리보기입니다. 그래서 내 질문은 :
- 이 코드는 C++ 11 표준에 맞습니까?
- 이 버그는 이미 알려져 있습니까?
버그 보고서를 찾았습니다. http://connect.microsoft.com/VisualStudio/feedback/details/729760/std-async-fails-compilation-for-callable-with-two-or-arguments – yohjp