7
std::atomic<int> index;
工作?
目前使用LLVM 3.1与这些PARAMS
C Language Dialect GNU [-std=gnu99]
C++ Language Dialect [-std=c++11]
C++ Standard Library libc++(LLVM C++ standard library with C++11 support)
std::atomic<int> index;
工作?
目前使用LLVM 3.1与这些PARAMS
C Language Dialect GNU [-std=gnu99]
C++ Language Dialect [-std=c++11]
C++ Standard Library libc++(LLVM C++ standard library with C++11 support)
有需要是真实的为您的代码工作的几件事情:
您需要#include <atomic>
你需要将代码编译为C++ 11或C++ 14(-std=c++11
或-std=c++14
(或c++0x
))编译器))
你的编译器和标准库需要支持足够的C++ 11提供atomic
(http://clang.llvm.org/cxx_status.html)
你需要把它写成下面以定义的变量。
std::atomic<std::int> index;
你有没有'#包含''头? –
@AndyProwl #error未执行 我想那就是 –
Hobbyist
听起来很可能。顺便说一句,这是一个很好的习惯,也提供你得到的错误信息(如果你收到任何)。 “不起作用”可能意味着什么。 –