T
Tony Johansson
Hello Experts!!
Assume I have a base class called animal. I want this class to be abstract
so I make the destructor pure virtual by having this statement.
virtual ~Animal() = 0;
Destructor will never be inherited.
Now to my question why do I have to give a body {} at least the empty body
to the pure virtual destructor.
What's the difference between
virtual ~Animal() = 0; and virtual ~Animal() = 0 {};
Normally when you have pure virtual destructors you almost never give any
kind of body to the function.
Many thanks.
//Tony
Assume I have a base class called animal. I want this class to be abstract
so I make the destructor pure virtual by having this statement.
virtual ~Animal() = 0;
Destructor will never be inherited.
Now to my question why do I have to give a body {} at least the empty body
to the pure virtual destructor.
What's the difference between
virtual ~Animal() = 0; and virtual ~Animal() = 0 {};
Normally when you have pure virtual destructors you almost never give any
kind of body to the function.
Many thanks.
//Tony