Please Code 2 Different Ways Convert Uniqueptr Owning Name Object Sharedptr Owns Object E Q37271584

Question

a. Please code in 2 different ways to convert a unique_ptrowning a Name object to a shared_ptr which owns the same object.Then explain which way the best way is.

b.LinkedBag bagA contains: ‘M’, ‘i’, ‘c’, ‘k’, ‘e’, ‘y’ vectorvec contains: ‘M’, ‘o’, ‘u’, ‘s’, ‘e’ Use a copy constructor tocreate LinkedBag bagX using bagA. Then add entries from vector vecto bagX. Then remove all ‘e’ from bagX. Please explain in detailhow each step works and what bagX contains after

Scroll to top