In C++ destructor can be pure virtual:
class A{
public:
virtual ~A()=0;
};
But in every case it needs to be implemented:
inline A::~A() {}
Otherwise A is not usable class. I mean destruction of derived (S/B) is not possible. And possibility of destruction is needed in this line:
B* temp = new B;
because in case of throwed exception - compiler will automatically destructs temp...