readonly?

Ali Çehreli acehreli at yahoo.com
Wed Jul 11 09:51:37 PDT 2012


On 07/11/2012 08:52 AM, David Nadlinger wrote:

 > I fail to see anything inconsistent here.

Most other operations act on the object:

class B
{
     // ...
}

auto b = new B();

++b;    // on the object
b > b;  // on the object
// etc.
&b;     // on the reference

That can be seen as an inconsistency. Perhaps it is that the 
non-overridable operators are on the class reference?

Ali



More information about the Digitalmars-d-learn mailing list