Why are opCall's not implicitely assignable?

Karen Lanrap karen at digitaldaemon.com
Sat Sep 23 15:41:32 PDT 2006


Stewart Gordon wrote:

> Not if one is interested primarily in what it does, rather than
> how it does it.  Which is the whole point of properties.

Why has this to be restricted to properties?
What are properties at all?
Why is a member of a class that is a class with an opCall no property 
of that class?

import std.stdio;
class C{
    int opCall( int p){
        return 2*p;
    }
}

class D{
    C c;
    ~this(){
        c=new C;
    }
}
void main(){
    auto d=new D;
    auto i=d.c=2;
}


As you might notice, we are right back from where we started.
 



More information about the Digitalmars-d-learn mailing list