In Concurrency In Action, it is stated:
All operations on an atomic type are defined as atomic, and assignment and copy-construction involve two objects. A single operation on two distinct objects can’t be atomic.
But I'm a little confused
atomic<int> i1, i2;
i1 = 0;
i2 = 1;
i1 = i2; // error
i1.store(i2); // but it works, is this operation atomic?
The last line of the code completes the assignment, it also involved two objects