The problem on line 31
is given by the fact
that we are attempting to cast a pure virtual base class into a
derived class at compile-time: this is not possible. Instead, we have
to employ the dynamic_cast operator and replace line 31 with:
Derived* d = dynamic_cast<Derived*>(v);
This fixes the problem.
Leo Liberti
2008-01-12