Re:Why care about functional programming? Part 1: Immutability
by tjradcliffe on Friday March 20, 2015 @01:28AM
(#9236359)
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.)
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.)