Hiding class pointers -- was it a good idea?

Johan Granberg lijat.meREM at OVEgmail.com
Wed Aug 15 13:14:18 PDT 2007


Russell Lewis wrote:
> I don't see any fundamental reason why classes need to
> be reference types, other than history.

What about this situation.

//begin C++

class A{
        int val;
};
class B:public A{
        int foo;
};

int main(int argc,char**argvs){
        A a;
        B b;
        a=b;//HERE what happens to b's member foo?
}

//end C++

it's my impression that D's classes are reference types to avoid that
specific problem.



More information about the Digitalmars-d mailing list