mutable, const, immutable guidelines
Christian Köstlin
christian.koestlin at gmail.com
Thu Oct 10 11:39:29 PDT 2013
On 10/10/13 1:05 , qznc wrote:
Very interesting discussion!
> contract between caller and callee. If an argument is const, it means
> the callee says he can handle others changing the state concurrently.
i think what the usual understanding of const for an argument to callee
is, what is written at http://dlang.org/const3.html. that means for me,
that callee promises not to change the data itself. perhaps a bettr
description would be readonly.
usually you would think that no one else should change the data while
callee runs. but at least with c++ i could imagine running callee in a
thread with a reference to a const thing which changes underneath and
while callee is running.
More information about the Digitalmars-d-learn
mailing list