で使っfor_each
てみましたboost::trim
。そもそも間違ったコードを使った
std::for_each(v.begin(),v.end(),&boost::trim<std::string>));
// error: too few arguments to function
それから私はこれで(オンラインで読んで)修正しました
std::for_each(v.begin(),v.end()
,boost::bind(&boost::trim<std::string>,_1,std::locale()));
この関数を に渡す必要がある場合のコンパイラの動作for_each
。std::locale
コードの 2 番目の入力引数の既定のパラメーターなので、機能するはずboost::trim
だと思いました。