I am using g++ version 4.4.3 on Ubuntu OS. According to this matrix here it is supposed to support also std::atomic
. Each time I use
#include <atomic>
the compiler gives me an error and says error: atomic: No such file or directory
.
Have you experienced the same problem? I am compiling using the following line
g++ -std=c++0x -Wall myCode.cpp -o myApp</code>
The g++ utility supports almost all mainstream C++ standards, including c++98 , c++03 , c++11 , c++14 , c++17 , and experimentally c++20 and c++23 . It also provides some GNU extensions to the standard to enable more useful features.
Master C and Embedded C Programming- Learn as you goC++98 − GCC has full support for the 1998 C++ standard as modified in 2003 and renamed to C++03 and some later defect reports. C++11 − GCC 4.8. 1 was the first complete implementation of the 2011 C++ standard, previously known as C++0x.
(since C++11) Each instantiation and full specialization of the std::atomic template defines an atomic type. Objects of atomic types are the only C++ objects that are free from data races; that is, if one thread writes to an atomic object while another thread reads from it, the behavior is well-defined.
std::atomic is neither copyable nor movable. The compatibility macro _Atomic is provided in <stdatomic.
Try #include <cstdatomic>
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With