我试图创建结构变量的原子数组。但我不能将值分配给任何数组元素。 struct snap {
int number;
int timestamp;
};
atomic<snap> *a_table;
void writer(int i, int n, int t1)
{
int v, pid;
int t1;
a_table
继Multiple assignment in one line后,我很想知道这对原子数据类型是如何工作的,特别是对于布尔类型的例子。 考虑: class foo {
std::atomic<bool> a;
std::atomic<bool> b;
public:
void reset();
[...] //Other methods that