"David White" <no@email.provi ded> wrote
They might be homework, but now I'm curious. Abstract classes I know, but
"pure abstract classes" I haven't come across. I would have guessed that
"pure" somehow came across from "pure virtual" and is redundant or
inappropriate. Or is a "pure abstract class" one that contains nothing but
an interface of pure virtuals? If so, "pure abstract" sounds more like an OO
term than a C++ term.
You can have pure virtual functions and you can have abstract base classes. You
can't have pure abstract classes. That's just someone mingling unrelated
concepts. Those who do are usually trying to attach a name to a class that has
only pure virtual functions. This, of course, is clearly impossible because every
class must have at least one constructor -- either explicitly or implicitly
defined -- if it's to be instantiated or inherited from and constructors cannot
be virtual. Some add to this fabricated definition that the so-called "pure
abstract class" can have no data members. Others try to call it an interface.
Since these terms are bogus to start with in the context of C++, it's really
irrelevant what rules anyone tries to impose on them. :-)
This is actually symptomatic of something that we see fairly often: some people
are uncomfortable with the vast number of combinations that C++ offers and try to
label and compartmentaliz e specific combinations. Once an arbitrary combination
has been named, these people feel more secure in criticizing code that falls
outside their little subset of absorbed concepts by saying things like, "You're
doing that wrong. You should be using a pure virtual abstract ethereal diaphanous
base class as described in the 'Horde of Sixty-Two' book."
Claudio Puviani