C++template 5.2

template <typename T>
class A{
    public:
        void t(){
            cout<<"BASE"<<endl;
        }
};

template <typename T>
class B:public A<T>{
    public:
        void fo(){
            A<T>::t();
        }

};

fo()内部调用决定哪个t(),并不会考虑A类中定义的t().

posted @ 2015-06-05 11:46  酷酷的门门  阅读(91)  评论(0编辑  收藏  举报