I’m not a C++ programmer but I like the idea of contracts. I’d be happy to have them in Java.
However, I think it’s insane to allow them to modify values. I get it probably really hard to prevent that in C++, but man is that going to be insanely hard to reason about.