Suppose we have a (toy) C++ class such as the following:
class Foo {
public:
Foo();
private:
int t;
};
Since no des
I agree with David except that I would say it is generally a good practice to define a virtual destructor i.e.
virtual ~Foo() { }
missing out virtual destructor can lead to memory leak because people who inherit from your Foo class may not have noticed that their destructor will never be called!!