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