> C++ has a perfect match for Rust’s mutability: const and non-const.
Rust has inherited mutability, while I believe const in C++ is shallow. I don't think it's a perfect match.
members of a const struct are also const.
Now you obviously can still have escape hatches and cast the const away whenever you want.
members of a const struct are also const.
Now you obviously can still have escape hatches and cast the const away whenever you want.