История изменений
Исправление jeuta, (текущая версия) :
А можно и закрыто унаследоваться от неё.
Вот так что ли?
struct FooProperties {
int x;
string y;
...
}
class Foo;
struct Bar {
Foo* mFoo;
}
class Foo : private FooProperties {
public:
Foo (const Foo& other)
: FooProperties (other) {
mBar.mFoo = this;
}
getFoo () { return mFoo }
...
private:
Bar mBar;
}
Исходная версия jeuta, :
А можно и закрыто унаследоваться от неё.
Вот так что ли?
struct FooProperties {
int mFoo;
string mBar;
...
}
class Foo;
struct Bar {
Foo* mFoo;
}
class Foo : private FooProperties {
public:
Foo (const Foo& other)
: FooProperties (other) {
mBar.mFoo = this;
}
getFoo () { return mFoo }
...
private:
Bar mBar;
}