On Saturday, 4 August 2012 at 07:15:50 UTC, Jonathan M Davis
wrote:
The problem is that if the this pointer/reference is const,
then you can't call any member functions which aren't const,
and you can't call any non-const functions on any member
variables, because _they're_ const, because the this
pointer/reference is const. And there are plenty of types out
there which _can't_ have many of their member functions be
const and do what they need to do, because D's const is both
physical and transitive (unlike C++'s const). So, it's quite
easy to get into a situation, where you can't call much of any
functions at all if the this pointer/reference is const even
though calling the non-const functions wouldn't actually mutate
anything.
Data-wise I see it both as a problem, and not as a problem. so
contracts and invariants and debug statements should have the
@safe, pure, and const nature stripped for debugging support.
I would think it does however during verbose output specifying
if an invariant or contract is changing data and that may alter
behavior.