On C++ primer 5 edition. Chapter 12. Dynamic memory: It is written:
shared_ptr p(u); P assumes ownership from the
uniqe_ptru; makesunull. shared_ptr p(q, d) Assumes ownership for the object to which the built-in pointerqpoints.qmust be convertible toT*($4.11.2, p.161).pwill use the callable objectd($10.3.2, p.388) in place ofdeleteto freeq.
- I didn't understand "Assumes ownership from the
unque_ptrand for the object to which the built-in...".
Can someone explain to me this paragraph? Thanks so much.
Aucun commentaire:
Enregistrer un commentaire