Hi H.S., > Le 18 nov. 2020 à 13:44, H. S. Teoh <[email protected]> a écrit : > > D unfortunately does not have "logical const".
Yeah, I ventured that. But I'm not sure one can call this "unfortunate". It might well be one of these nice ideas that end up making things way more complex. I like having it in C++, but whether it is truly a blessing, that I don't know for sure. > It has "physical const" > which is mechanically enforced by the compiler. Furthermore, const is > "infectious" (transitive): once a reference is marked const, everything > it refers to is also const, as far as can be seen via that reference. A > const reference can refer to a mutable object, but you cannot modify the > object through that reference, it can only be mutable through a mutable > reference. These are clear, simple, intuitive rules. Thanks for insight. Cheers!
