As far as I know, const only protect from updates that the compiler can detect at compilation time. Moreover, the C/C++ code does not make use of true referential transparency properties, for example const a=1; const b=a perform a copy of content of a to b . In haskell a=1; b=a make b to point to a directly.
> In C/C++ referential transparent functions code can be declared byFor one thing, some fields in a const C++ object can be explicitly set
> appending a 'const' to the prototype, right?
mutable. mutable is sometimes used in C++ a similar way to
unsafePerformIO in Haskell. You have something that uses mutability in
its internals but that mutability shouldn't be observable to the
caller. In both cases you have no means of actually ensuring that the
mutability is actually unobservable.
--
Dan