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