Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

std::atomic support in g++ 4.4.3

Tags:

c++11

atomic

g++

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>
like image 232
Abruzzo Forte e Gentile Avatar asked Jan 06 '11 22:01

Abruzzo Forte e Gentile


People also ask

What version of C++ does g ++ support?

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.

Which version of C++ does GCC support?

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.

What is std :: atomic in C++?

(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.

Is STD atomic copyable?

std::atomic is neither copyable nor movable. The compatibility macro _Atomic is provided in <stdatomic.


1 Answers

Try #include <cstdatomic> instead.

like image 117
Raphael Bossek Avatar answered Sep 22 '22 23:09

Raphael Bossek