Transitive const sucks
Nathan Reed
nathaniel.reed at gmail.com
Wed Sep 12 12:31:26 PDT 2007
Bruce Adams wrote:
> You were totally clear but using a C++ concept of const methods which I believe (and may be wrong) has no analogue in D. I believe the intention was to keep it out of the language as it is an ambomination. That said, I'm not clear how you can get the proper semantics for e.g. overloads of [] in D without it.
>
> Bruce.
I believe the issue of overloading opIndex and similiar is going to be
taken care of using the 'return' storage-class (discussed in
WalterAndrei.pdf). Basically it makes the return type of the function
const or not, according to whether a particular parameter (e.g. 'this')
is const or not.
Thanks,
Nathan Reed
More information about the Digitalmars-d
mailing list