首页 > 试题广场 >

#include void func...

[单选题]
#include <functional>

void func(int x, int y) {};
auto l = [](int x, int y) {};

class C {
public:
    void operator () (int x, int y) const {};
    void memfunc(int x, int y) const {};
};
基于以上C++代码,以下定义无法通过编译的是()
  • std::bind(func, 10, 20)();
  • std::bind(l, 10, 20)();
  • std::bind(C(), 10, 20)();
  • std::bind(&C::memfunc, 10, 20)();
成员函数在调用时需要一个this指针指向当前对象
发表于 2025-10-08 15:26:18 回复(0)