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

Sure. I've just only rarely encountered the situation you're describing. When it comes up, passing a shared_ptr by const reference is fine --- just so long as it's documented and the code explains "Look, I know this looks like a newbie error, but in context, it's actually an optimization. Here's why..." lest someone "optimize" away the deferred load win.


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

Search: