简体   繁体   English

在msvc ++ 2010 express中似乎找不到std :: thread

[英]can't seem to find std::thread in msvc++ 2010 express

I've been reading about various new additions to c++ recently that i'm really excited about and i've already been through the new std::unique_ptr and std::shared_ptr objects, which are incredibly useful, and now i'm looking for that native thread library i've heard about and can't seem to find it anywhere. 我最近一直在阅读有关c ++的各种新内容,这些让我感到非常兴奋,并且我已经遍历了新的std :: unique_ptr和std :: shared_ptr对象,它们非常有用,现在我正在寻找对于我听说过的本机线程库,似乎无法在任何地方找到它。 I was reading and went looking for thread.h and msvc++ 2010 express doesn't seem to have it. 我正在阅读并去寻找thread.h,而msvc ++ 2010 express似乎没有它。 Did the newest versions of msvc++ not come with this new thread library, or is it just the express version that doesn't come with it, or am i just being silly and have to go looking for a copy of it on the internet? msvc ++的最新版本是否没有随此新的线程库一起提供,或者仅仅是它随附的快速版本,还是我很傻并且不得不在互联网上寻找它的副本? I currently have to do threading via windows functions which i feel are overcomplicated when trying to use mutexes and they're also operating system specific, so i'm really excited to find this standard library implementation :\\ 我目前必须通过Windows函数进行线程处理,这些函数在尝试使用互斥锁时感觉过于复杂,而且它们也是特定于操作系统的,因此,我为找到这种标准库实现感到非常兴奋:

Not all C++11 changes are in the Visual C++ 2010 compiler. 并非所有C ++ 11更改都在Visual C ++ 2010编译器中。 You will need to use boost::thread or just::thread as alternatives, or use the Visual Studio 11 Beta : 您将需要使用boost :: thread或just :: thread作为替代方案,或使用Visual Studio 11 Beta

None of the editions of VS2010 come with std::thread . VS2010的所有版本均未附带std::thread Remember that VS2010 pre-dated the C++11 standard. 请记住,VS2010早于C ++ 11标准。

You could try boost::thread as an alternative. 您可以尝试使用boost::thread作为替代方案。 The design of std::thread is an evolution from boost::thread and so it should not be too traumatic to switch to std::thread when it becomes more widely implemented. std::thread的设计是从boost::thread演变而来的,因此在更广泛地实现时切换到std::thread不应太过分。

VS2012 Beta将于本月发布,将优于开发人员预览版。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM