3 ms·
I'm not completely understanding the recommendation for #5: Recommendation: If you’re not using make_shared to create the shared_ptr , at least create the obje
by TwoBit 10y ago
I'm not completely understanding the recommendation for #5:
Recommendation: If you’re not using make_shared to create the shared_ptr , at least create the object managed by the smart pointer in the same line of code – like :
shared_ptr<aircraft> pAircraft(new Aircraft("F-16"));
</aircraft>
I think he really means to say that the second shared_ptr is better initialized from the first shared_ptr instead of the raw ptr.