On Friday, 3 August 2012 at 20:48:29 UTC, Alex Rønne Petersen wrote:
The problem here is that making invariants const *now* means that using them in conjunction with Phobos code becomes next to impossible. Casting away const will become common practice, and that ain't exactly the way we want to go. :/

Doesn't 'const' only qualify for the object's (this) code? If that's the case, you could have a global object inside a debug statement, then put those inside the invariants so you get your output (say, in a text file), while keeping it const. Having no side effects is pure, meaning global state would be unreachable (and debug already bypasses pure, but not safe).

Reply via email to