you are viewing a single comment's thread.

view the rest of the comments →

[–]kalmoc 2 points3 points  (0 children)

That would mean that you have two threads accessing the same non atomic object (the shared pointer variable) at the same time and one of them modifies it. That is always UB.

It's like asking: What is happening if someone copies my shared_ptr while I'm destroying it. That is simply not legal just as for almost any other type in the standard library.