문제

I am using Visual C++ 2010. Does it support the C++11 threads library, such that I could compile the code in this question?

If not, what library can I use that would support this?

도움이 되었습니까?

해결책

Visual C++ 2010 does not provide the C++11 thread support or atomics libraries.

If you want to use that code in Visual C++ 2010, you'll need to use a third-party implementation of those libraries. One option is just::thread; it's not free, but I have a copy and am quite pleased with it.

Alternatively, you can use another cross-platform threads library like Boost.Thread or OpenThreads or one of the native Windows threads libraries. Any of these options will probably require changes to the code in order to run.

Note that Visual C++ 11 will support these libraries, and they are included in the Visual C++ 11 Beta.

다른 팁

VC++ supports special embedded syntax OpenMP (http://msdn.microsoft.com/en-us/library/tt15eb9t(VS.80).aspx) - note, that g++ is also suports it, so you can get cross platform code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top