The question is the following: consider this piece of code:
#include
class aClass
{
public:
void aTest(int a, int b)
{
prin
@Pete Becker's answer is fine but you can also do it without passing the class instance as an explicit parameter to function1 in C++ 11:
#include
using namespace std::placeholders;
void function1(std::function fun)
{
fun(1, 1);
}
int main (int argc, const char * argv[])
{
...
aClass a;
auto fp = std::bind(&aClass::test, a, _1, _2);
function1(fp);
return 0;
}