关于c++的虚函数表有关问题

关于c++的虚函数表问题
C/C++ code

#include <iostream>
using namespace std;
class A{
    public:
    virtual void g(){
        cout << "A::g" << endl;
    }
    private:
    virtual void f(){
        cout << "A::f" << endl;
    }
};

class B:public A{
    void g(){
        cout << "B::g" << endl;
    }
    virtual void h(){
        cout << "B::h" << endl;
    }
    int a;
};

typedef void (*fun)(void);

int main(){
    B b;
    fun pfun;
    for (int i = 0; i < 3; i++){
        pfun = (fun)*((int*)*(int*)(&b)+i);
        pfun();
    }
    return 0;
}



上面这段程序,程序运行结果是
B::g
A::f
B::h
我所不能理解的是,在深度理解c++对象模型中讲的是,虚表的第一个位置是类型信息,但是在这里,我却找不到类型信息,那么这个类型信息存放在哪里呢?

------解决方案--------------------
这个不要抓住书本不放啦。那本书的C++编译器是很老的。和现在的编译器不一样了。
但是编译器厂商都会将类型信息写到虚表中,但是在程序中,我没看到啊,第0个位置就直接是第一个虚函数了。。。
但是你的确没有看到啊。
------解决方案--------------------
学习C++时,就没听说类的vtble里还有类型信息
------解决方案--------------------
不同编译器不一样的。
typeid
------解决方案--------------------
在vs2008中type_info的地址在虚函数表前面,刚刚测试并打印出来了,下面代码中
*(((int*)*(vptr-1))+3)也就是取前一个指针的高字节处
C/C++ code

int main(){
    B b;
    fun pfun;
    for (int i = 0; i < 3; i++){
        pfun = (fun)*((int*)*(int*)(&b)+i);
        pfun();
    }


    int* vptr = (int*)*(int*)(&b);
    const type_info* ti = (const type_info*)*(((int*)*(vptr-1))+3);
    std::cout << ti->name() << std::endl;    

    return 0;
}