Does std::atomic<std::string> work appropriately?
问题 I am reading through Anthony Williams' "C++ Concurrency in Action" and in Chapter 5, which talks about the new multithreading-aware memory model and atomic operations, and he states: In order to use std::atomic<UDT> for some user-defined UDT , this type must have a trivial copy assignment operator. As I understand it, this means that we can use std::atomic<UDT> if the following returns true: std::is_trivially_copyable<UDT>::value By this logic, we shouldn't be able to use std::string as a