4
为什么要使用“ using”关键字来访问我的基类方法?
我编写了以下代码,以解释我的问题。如果我注释第11行(使用关键字“ using”),则编译器不会编译该文件并显示此错误:invalid conversion from 'char' to 'const char*'。void action(char)在Parent类中似乎看不到该类的方法Son。 为什么编译器以这种方式运行?还是我做错了什么? class Parent { public: virtual void action( const char how ){ this->action( &how ); } virtual void action( const char * how ) = 0; }; class Son : public Parent { public: using Parent::action; // Why should i write …
75
c++
oop
inheritance
using