int main(int argc, char *argv[])
{
ttt *t = new ttt();
t->foo();
delete t;
t->foo();
return 0;
}
class Test2 : public Test
{
private:
typedef Test Super;
public:
Test2& operator = (const Test& x);
};
Test2& Test2::operator = (const Test& x)
{
Super::operator = (x);
// придумай, что сделать с недостающими полями
return *this;
}
There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.
И еще один интересный момент:
Turn captions on/off -- c
return *new obj (this->a + xa.a);
return obj (this->a + xa.a);