vendredi 30 décembre 2016

How does the control block of a shared pointer behave with const shared pointers

const std::shared_ptr<int> x (new int (2));
const std::shared_ptr<int> y (x);

copying a shared pointer makes changes to the control block where the 'const' shared pointers point to, does that not contradict the constness part?

Aucun commentaire:

Enregistrer un commentaire