I am trying to use boost::trim
on a vector of strings. I understand that this solutions works elegantly, however I cannot understand why
std::for_each(df.colnames.begin(), df.colnames.end(),
std::bind2nd(std::ptr_fun(boost::trim<std::string>), std::locale()));
doesn't work. I get error:
error: ‘typename _Operation::result_type std::binder2nd<_Operation>::operator()(typename _Operation::first_argument_type&) const [with _Operation = std::pointer_to_binary_function<std::basic_string<char>&, const std::locale&, void>; typename _Operation::result_type = void; typename _Operation::first_argument_type = std::basic_string<char>&]’ cannot be overloaded
Why std::bind2nd
doesn't work here?