Atomic struct containing pointer

前端 未结 1 1423
孤城傲影
孤城傲影 2021-01-25 03:20
#include 
#include 

using namespace std;

struct Simple{
    int a = 0;
    int b = 0;
};

struct WithPointer{
    int *a = nullptr;
    i         


        
1条回答
  •  被撕碎了的回忆
    2021-01-25 03:23

    You need to compile the program with the -latomic flag on clang and gcc. demo.

    0 讨论(0)
提交回复
热议问题