// new callbacks based on C++11
#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__)
#define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__)
#define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__)
#include <iostream>
#include <functional>
using namespace std;
#define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2)
#define COUT(...) cout<<"1111"##__VA_ARGS__
class plane
{
public:
void fun(int a, int b)
{
cout<<"fun"<<endl;
}
void func()
{
std::function<void(int, int)>p = CC_CALLBACK_2(plane::fun, this);
p(1,2);
}
};
int main()
{
plane *p = new plane;
p->func();
COUT("222");
}