Here is an example:
This is safe:
std::atomic_int i;
// Thread 1
i = 4;
// Thread 2
std::cout << i.load();
But is this safe to write:
std::atomic_int *i = new std::atomic_int;
// Thread 1
*i = 4;
// Thread 2
std::count << (*i).load();
My main rationale is that I want to have vector of atomics. Since atomics are not CopyConstructible, I need pointers to atomics to store into vector.