From "thinking in C++: "The typeid operator always produces a reference to a
static type_info object that describes the dynamic type of the object."
Why the following code output MI? Should it be Mi2? What does "static type_
info object" mean above?
*b2: 2MI
*mip: 2MI
*b1p: 2MI
mi2p not casted
#include
#include
#include
using namespace std;
class B2 {
public:
virtual ~B2() {}
};
class MI : public B2 {};
class Mi2 : public MI {};
void f(B2* &b2p)
{
delete b2p;
b2p