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

The No-No-Whatever case should be ˋconst Widget` or did I miss something?

Passing a shared_ptr by const ref is okay if you’re absolutely sure about your (smart) pointer lifetime. I’m never really sure or how things will evolve... Yesterday is history, tomorrow a mystery!

That’s why rust’s lifetimes rock!



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

Search: