我正在尝试const在类中调用函数,但const存在具有相同名称的非函数.
const
注意:我不能只改变名字.
class MyQuestion { void fun() { cout<<"a"; } void fun()const { cout<<"b"; } void call() { fun();//<how to call fun() const? } };
c++ overloading const
c++ ×1
const ×1
overloading ×1