Hacker News new | ask | show | jobs
by tjradcliffe 4114 days ago
You can. If you want to write immutable C++ simply declare every single variable const. Done.

The only difference between C++ and "immutable by design" languages is that in C++ you'd have to write your own little processor to ensure that your rule is followed (this is no big deal, and I've written much more complex processors to enforce C++ coding standards as part of the build.)