I have always wondered why we code
virtual void MyFunction() = 0;
and not
pure virtual void MyFunction();
Is there a reference for the basis of this decision?
ckeywordssyntaxvirtual-functions
I have always wondered why we code
virtual void MyFunction() = 0;
and not
pure virtual void MyFunction();
Is there a reference for the basis of this decision?
Best Answer
From The Design and Evolution of C++ - Bjarne Stroustrup - Addison-Wesley (ISBN 0-201-54330-3) - chapter 13.2.3:
Anyway looking at the C++ standard (ยง 9.2 - Class members)
= 0
is called pure-specifier.