0
我試圖在字符串的矢量上使用boost::trim
。據我所知,this solutions做工考究,但是我不明白爲什麼boost :: trim和std :: bind2nd
std::for_each(df.colnames.begin(), df.colnames.end(),
std::bind2nd(std::ptr_fun(boost::trim<std::string>), std::locale()));
不起作用。我收到錯誤:
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
爲什麼std::bind2nd
在這裏不起作用?