这个黑孩子不大力# Joke - 肚皮舞运动
K*g
1 楼
今天面试被问到template class怎么处理Inheritance问题,我没有答上来,觉得
template class处理inheritance应该与普通的class没有什么区别。
放下电话后,在effective C++的item43里找到了,derived class cannot inherit
public functions from the base class, we need use this->, or using to use
public functions from the base class in the derived class.
但是,我写了个程序, derived class still can inherit public functions from
the base class.(用的是g++编译器)
请问C++的大牛们,到底哪个对啊?难道这种东西是compiler dependent的?
还有这个面试题应该怎么回答呢?多谢了
template class处理inheritance应该与普通的class没有什么区别。
放下电话后,在effective C++的item43里找到了,derived class cannot inherit
public functions from the base class, we need use this->, or using to use
public functions from the base class in the derived class.
但是,我写了个程序, derived class still can inherit public functions from
the base class.(用的是g++编译器)
请问C++的大牛们,到底哪个对啊?难道这种东西是compiler dependent的?
还有这个面试题应该怎么回答呢?多谢了