Is it safe to use the Structure dereference(->) operator on the result of std::atomic::load
问题 Whilst trying to work with std atomic pointer, I ran into the following. Say I do this: std::atomic<std::string*> myString; // <do fancy stuff with the string... also on other threads> //A can I do this? myString.load()->size() //B can I do this? char myFifthChar = *(myString.load()->c_str() + 5); //C can I do this? char myCharArray[255]; strcpy(myCharArray, myString.load()->c_str()); I'm pretty sure C is illegal because myString might be deleted in the meantime. However I'm unsure about A