Thanx Richard. But what I meant to say is as follows:
C++ Prog. Lang, by Stroustrup, Pg.360
If I want to invoke the method of actual object I would pass the reference as in the code above.
But suppose I want to invoke the base class version of debug_print() irrespective of the kind of expression thrown, I would have the catch clause as
=========================
Richard u r right in saying that implementer had chosen to override the base class method for some purpose.
But just look at the example in the code. The exception of Matherr was caught as the default case. I don't want to look at the particulars of exactly which kind of exception it was, just it should print the Base class version of debug_print().
There r cases when u receive an object from some Factory. U really don't know what is the exact class of it (whether it is Base class object or one of the Derived class object). Since u don't know the class names of all the Derived classes, u can't check with instanceof operator.
In such cases what is the solution ? Basically, I want to suppress
polymorphism.