Okay, so I'm a little confused on how to implement a destructor for a class which only has data members with automatic storage duration. Like, say you had these classes:
1 2 3 4 5 6
class A {
public:
virtual ~A();
private:
size_t p;
};
1 2 3 4 5 6
class B : public A {
public:
virtual ~B();
private:
char t;
};
How would you implement A::~A() and B::~B()? The only examples the notes and book give about explicitly defining constructors are when classes contain pointers to things on the heap, which doesn't apply here.
My best guess (and this is just a guess since I can't find anything out for sure) is to simply give the A::~A() and B::~B() empty bodies, but I'm really not sure. Clarification would be appreciated!