"Vladimir Grigoriev" <vlad.moscow@mail.ru> wrote in message
news:ufzNN1oaJHA.4288@TK2MSFTNGP06.phx.gbl
"Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote in message
news:%23bhFs8LaJHA.4684@TK2MSFTNGP03.phx.gbl...
In C++, you always get whatever behavior the base class had. Pure
virtual functions have no implementation, so then you have interface
implementation in effect.
Pure virtual functions have implementation. It is an abstract class
that has no implementation as an object. Am I wrong?
You are wrong. While pure virtual functions may, in principle, have
implementation, it is highly unusual. Most of the time, they don't.
In C++, an abstract class is a class that has at least one pure virtual
function. It can also happily have non-virtual or non-pure member
functions, complete with implementation.
Consider:
class AbstractClass {
virtual void PureVirtualNoImplementation() = 0;
virtual void PureVirtualWithImplementation() = 0;
virtual void NonPureVirtual() {}
void NonVirtual() {}
};
void AbstractClass::PureVirtualWithImplementation() {}
--
With best wishes,
Igor Tandetnik
implementation, it is highly unusual." are two different things. So I do
not see that I am wrong.