logoalt Hacker News

wtetznerlast Monday at 9:50 AM1 replyview on HN

> 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.


Replies

mgaunardlast Monday at 10:31 AM

members of a const struct are also const.

Now you obviously can still have escape hatches and cast the const away whenever you want.

show 1 reply