Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: