#include
#include <functional>
class Test
{
public:
static void func(int a);
};
class Func
{
public:
static void test(void (*funcptr)(int a),int b);
void fs(void (*funcptr)(int a),int b);
};
void Test::func(int a) {
printf("a = %d\n", a);
}
void Func::test(void (*funcptr)(int a),int b) {
if(b > 0){funcptr(b);} // a = 10
}
void Func::fs(void (*funcptr)(int a),int b) {
auto fn_half = std::bind(test,funcptr,std::placeholders::_1);
fn_half(b);
}
int main(void) {
Test c;
Func f;
//auto f = c.
f.fs(c.func,5);
//fs(5);
return 0;
}