mercredi 29 juin 2016

Why atomic overloads for shared_ptr exist

Why are there are atomic overloads for shared_ptr as described here (http://ift.tt/1jrtS5s) rather than there being a specialization for std::atomic which deals with shared_ptrs. Seems inconsistent with the object oriented patterns employed by the rest of the C++ standard library..

And just to make sure I am getting this right, when using shared_ptrs to implement the read copy update idiom (http://ift.tt/1ltw7nl) we need to do all accesses (reads and writes) to shared pointers through these functions right?

Aucun commentaire:

Enregistrer un commentaire