When using atomic type in c++
Why does std::atomic<T>::operator= should return a value instead of reference? It's not like other common assignment operator which returns a reference.
From a cppreference site I can get some hint.
Unlike most assignment operators, the assignment operators for atomic types do not return a reference to their left-hand arguments. They return a copy of the stored value instead.
I can guess that if I use reference, it has a problem of atomic things. But I'm not completely clear.
Do you have any example for the async error case ?
And if I return a value instead of a reference, why does the async error gone?