Atomic struct containing pointer
问题 #include <atomic> #include <iostream> using namespace std; struct Simple{ int a = 0; int b = 0; }; struct WithPointer{ int *a = nullptr; int b = 0; }; int main(int argc, char const *argv[]) { atomic<Simple> simple; cout<<simple.is_lock_free()<<"\n"; atomic<Simple*> simple_p; cout<<simple_p.is_lock_free()<<"\n"; atomic<WithPointer> with_pointer; cout<<with_pointer.is_lock_free()<<"\n"; return 0; } This example works fine for the Simple struct but not for the WithPointer struct. I get the