小编Mat*_*fer的帖子

用&(和号)重载C++成员函数

如何选择正确的error()成员函数?我需要以某种方式施展吗?

using namespace std;

struct test
{
   int error();
   void error(int x);
   int fun();
};

int main() {
   auto f1 = &test::error; // how to pick the correct function?
   auto f2 = &test::fun; // works
}
Run Code Online (Sandbox Code Playgroud)

c++ overloading ampersand c++11

27
推荐指数
2
解决办法
1973
查看次数

标签 统计

ampersand ×1

c++ ×1

c++11 ×1

overloading ×1