ChaosEngine, that is close.
For those who are not interested in esoteric properties of C++, read ChaosEngine's post, and believe it. For those that are...
virtual void foo() = 0;
does exactly three things.
First, it says "you cannot create an instance of this class".
Second, it says "if you inherit from this class, and do not override foo, you cannot create an instance of that class either".
Finally, it says "it is
allowed for there to be no implementation of foo() in this class".
It does not, however, _prevent_ you from making an implementation of foo for this class.
This allows you to create a default/helper method that children must explicitly say they are using, while still demanding that the children explicitly override your foo().
I've seen about 2 or 3 good uses for this.
First:
class bar { virtual void foo() = 0;};void bar::foo() { this->foo();}
allows for some syntactic sugar of:
bar* meh;meh->bar::foo();
which would otherwise segfault. I've seen corner cases where this helps.
The above is questionable, because it is a bit too much of a language-morph.
Second, as a form of ghetto "overrides" keyword. In C++, a child class does not distinguish between a method that overrides a virtual method from the parent, and new methods. By making the parent class methods virtual = 0, and requiring that child class methods who want the default behaviour explicitly call the parent class, changes in the parent class interface that are not followed by changes in child class interfaces result in compile-time errors.
In a language that supports keywords like "initial" and "overrides" and the like, this isn't needed. C++ lacks them.
Both of these are edge cases, and probably not worth the strange looks you'll get from the 99% of the C++ population that doesn't know you can implement a pure virtual method. Ie, even though they solve problems, they probably create more problems than they solve.