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

Unfortunately a const shared_ptr is like a const raw pointer: you can't change the pointer itself, but can still modify what it points to.


You can do const shared_ptr<const type>, it's like a const * const raw pointer.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: