Quantcast
Channel: in-class initialization of atomic - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Jarod42 for in-class initialization of atomic

atomic<int> x = 1; // not an assignment.isatomic<int> x{atomic<int>{1}};whereas atomic<int> x;x = 1; // assignment

View Article


Answer by Lightness Races in Orbit for in-class initialization of atomic

std::atomic<int> x = 1; is copy-initialisation, and basically does this:std::atomic<int> x{std::atomic<int>{1}};Your compiler actually doesn't complain about operator=, but instead...

View Article

in-class initialization of atomic

Why in this examplestruct Foo { atomic<int> x = 1;};the compiler (gcc 4.8) is trying to use the atomic& operator=(const atomic&) which is deleted, (hence the example wont compile), while...

View Article
Browsing latest articles
Browse All 3 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>