so i'm trying write copy constructor class e such every int x each class , assign counterpart. how cast right side?
class { public: int x; }; class b: public virtual { public: int x; }; class c: public virtual { public: int x; }; class d : public b, public c { public: int x; }; class e: public d { public: int x; e(const e& e) { e::x = (e)e.x // problem d::x = ? c::x = ? b::x = ? a::x = ? } };
you not need cast int assign int. do:
self->x = ((e)e).x; d::x = ((d)e).x;
Comments
Post a Comment