What are sensible use cases for this?
If the function has a sensible default implementation, or a partial implementation of whatever is relevant to the base class, but you still want to force derived classes to override it, that's a good place to put it.
Also, as noted in the comments, you might want to force a class with no pure virtual functions to be abstract. You can do this by making the destructor pure virtual; but the destructor must have a body, whether or not it's pure virtual.
when would
A::foo
ever be called?
It can only be called non-virtually; for example:
struct B : A {
void f(int i) const {
A::foo(i); // non-virtual call
// Do the B-specific stuff
}
};
why is this the correct/best implementation?
The alternative would be to invent a new name for the partial/default implementation, in addition to an unimplemented pure virtual function.
Are there any differences here between C++03 and C++11?
No.