How come it's possible to have a base class with a pure virtual destructor and nonetheless one has to implement the destructor? Doesn't pure virtual mean that there is no implementation of that method in the base class and the implementation is left entirely up to derived classes?
[code=cpp]
class Base
{
public:
Base() {}
virtual ~Base() = 0; // pure virtual destructor
}
Base::~Base() // <-- Linktime error if
{} // this implementation is omitted!
[/code]
In fact, it seems I can provide an implementaiton of any pure virtual base class method without error although the linker doesn't complain if I do not, like it does with the destructor.
[code=cpp]
class Base
{
public:
Base() {}
virtual ~Base() = 0; // pure virtual destructor
}
Base::~Base() // <-- Linktime error if
{} // this implementation is omitted!
[/code]
In fact, it seems I can provide an implementaiton of any pure virtual base class method without error although the linker doesn't complain if I do not, like it does with the destructor.
Comment