4 ms·
For pointers, const only affects whether you can re-set it to point to something else, not the pointee. Nothing prevents you from building a smart pointer with
by mgaunard 10mo ago
For pointers, const only affects whether you can re-set it to point to something else, not the pointee.
Nothing prevents you from building a smart pointer with those semantics though, std::indirect is an example of this (arguably closer to Rust's Box).