//win7, vs2013 update 5
struct aa
{
void foo(int) {}
};
struct bb : public aa
{
void foo(const char*) {}
void test()
{
foo(1); //C2664 cannot convert argument 1 from 'int' to 'const char *'
}
};
//win7, vs2013 update 5
struct aa
{
void foo(int) {}
};
struct bb : public aa
{
void foo(const char*) {}
void test()
{
foo(1); //C2664 cannot convert argument 1 from 'int' to 'const char *'
}
};
在 C++ 中若基类中有一个函数名被重载,在子类中重定义该函数,则基类的所有 版本将被隐藏——即子类只能用子类定义的,基类的不再可用。——名字隐藏特性。