3 ms·
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.
by millstone 10y ago
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.
- Too 10y agoYou can do const shared_ptr<const type>, it's like a const * const raw pointer.