| ▲ | wtetzner 3 days ago | |||||||||||||||||||||||||||||||||||||||||||
> 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. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | mgaunard 3 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
members of a const struct are also const. Now you obviously can still have escape hatches and cast the const away whenever you want. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||