std::bind
internally stores the std::decay
ed type of each argument. When passing test
, this results in it attempting to store an object of type ITest
, which is of course abstract.
It will work if you pass test
wrapped in a std::reference_wrapper
, as this causes std::bind
to store an lvalue reference to the object:
std::transform(v.begin(), v.end(), back_inserter(vRes),
bind(&ITest::Prueba, std::ref(test), _1, 0));
You can alternatively pass a pointer to the object, as std::bind
accepts this too:
std::transform(v.begin(), v.end(), back_inserter(vRes),
bind(&ITest::Prueba, &test, _1, 0));