#include <atomic>
int main()
{
auto a = std::atomic_int(1);
auto b = std::atomic_int(2);
std::swap(a, b); // error
}
error message:
error: no matching function for call to 'swap(std::atomic&, std::atomic&)'
Why can't std::atomic<T> be swapped?