classFuncFactory { public: FuncFactory() = default; inttest(int a, int b) { std::cout << "aaa: " << a << " b: " << b << std::endl; // throw -1; return a + b; }
voidtest2(int a, int b) { std::cout << "a2: " << a << " b2: " << b << std::endl; // throw -1; }
doubletest3(int a, int b) { std::cout << "a: " << a << " b: " << b << std::endl; // throw -1; return a + b; } };
doublebbb(int a, int b) { std::cout << "a: " << a << " b: " << b << std::endl; // throw -1; return a + b; }
intmain() { int a = 3; int b = 9; // WARP_CALL(bbb, a, b); FuncFactory yf; int res = wrap_call(bbb, a, b); std::cout << "result: " << res << std::endl; res = wrap_call(&yf, &FuncFactory::test, a, b); std::cout << "result2: " << res << std::endl; std::shared_ptr<FuncFactory> yf_ptr(new FuncFactory); res = wrap_call(yf_ptr.get(), &FuncFactory::test, a, b); std::cout << "result3: " << res << std::endl; }