On Thursday, 19 May 2016 at 20:44:54 UTC, ciechowoj wrote:
Is there D equivalent of C++'s mutable keyword? Like the one that allows to modify a field of struct from constant method. Or some alternative solution?

There isn't an equivalent of mutable keyword because D const differs from C++ const. D const has stronger guarantees (nothing reachable from const object will be mutable) so you'll use it less often compared to C++.

There's a talk on usage of const in D and I think its author also wrote on the subject:
https://www.youtube.com/watch?v=mPr2UspS0fE

Reply via email to