On Fri, 04 Feb 2011 22:44:51 +0200, Walter Bright <newshou...@digitalmars.com> wrote:

so wrote:
Examine the API of a function in a library. It says it doesn't modify anything reachable through its arguments, but is that true? How would you know? And how would you know if the API doc doesn't say?
You are right, but try to look at this from another angle (probably i am not making any sense here). Should "D const" be perceived this way?
When i say "const A", it broadly means don't assign to this.

That's "head const", which is what C++ has. The const system in C++ does not work. If you view const strictly as a storage class, that fails as soon as you introduce pointers.

No no! I mean the way it works in D. I tried to say that: because of the semantic of C++ const, it maybe maybe a good idea to have signatures but with the semantics in D const it is not that needed.

Reply via email to