c++compiler-errors

'atomic_uint32_t' in namespace 'std' does not name a type Error


I have the following line in my code:

#include <atomic>
    
std::atomic_uint32_t tmp;

However, I am getting the following compilation error:

'atomic_uint32_t' in namespace 'std' does not name a type.

I included <cstdint> but the error persists.

My GCC version: 5.4.0, Ubuntu 14.04 (64-bit)


Solution

  • As per Danh's comment, I used

    std::atomic<std::uint32_t>
    

    and voila, it is working now. Thanks Danh.