#include <algorithm>
#include <functional>
#include <vector>
struct Something
{
};
template<class T>
T Function(const T& x, int s)
{
// blah blah
return x;
}
int main()
{
std::vector<Something> data(20);
std::transform(data.begin(), data.end(), data.begin(), std::bind2nd(std::ptr_fun(Function<Something>), 8));
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGZ1bmN0aW9uYWw+CiNpbmNsdWRlIDx2ZWN0b3I+CgpzdHJ1Y3QgU29tZXRoaW5nCnsKfTsKCnRlbXBsYXRlPGNsYXNzIFQ+ClQgRnVuY3Rpb24oY29uc3QgVCYgeCwgaW50IHMpCnsKCS8vIGJsYWggYmxhaAoJcmV0dXJuIHg7Cn0KCmludCBtYWluKCkKewoJc3RkOjp2ZWN0b3I8U29tZXRoaW5nPiBkYXRhKDIwKTsKCXN0ZDo6dHJhbnNmb3JtKGRhdGEuYmVnaW4oKSwgZGF0YS5lbmQoKSwgZGF0YS5iZWdpbigpLCBzdGQ6OmJpbmQybmQoc3RkOjpwdHJfZnVuKEZ1bmN0aW9uPFNvbWV0aGluZz4pLCA4KSk7Cn0K
In file included from /usr/include/c++/4.8/bits/stl_function.h:731:0,
from /usr/include/c++/4.8/functional:49,
from prog.cpp:2:
/usr/include/c++/4.8/backward/binders.h: In instantiation of ‘class std::binder2nd<std::pointer_to_binary_function<const Something&, int, Something> >’:
prog.cpp:19:106: required from here
/usr/include/c++/4.8/backward/binders.h:159:7: error: ‘typename _Operation::result_type std::binder2nd<_Operation>::operator()(typename _Operation::first_argument_type&) const [with _Operation = std::pointer_to_binary_function<const Something&, int, Something>; typename _Operation::result_type = Something; typename _Operation::first_argument_type = const Something&]’ cannot be overloaded
operator()(typename _Operation::first_argument_type& __x) const
^
/usr/include/c++/4.8/backward/binders.h:153:7: error: with ‘typename _Operation::result_type std::binder2nd<_Operation>::operator()(const typename _Operation::first_argument_type&) const [with _Operation = std::pointer_to_binary_function<const Something&, int, Something>; typename _Operation::result_type = Something; typename _Operation::first_argument_type = const Something&]’
operator()(const typename _Operation::first_argument_type& __x) const
^