将boost :: algorithm :: to_lower与std :: for_each一起使用

时间:2013-10-25 08:59:25

标签: c++ boost std c++98

我正在尝试编译以下内容:

#include <boost/bind.hpp>
#include <boost/functional.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>

...

std::vector<std::string> names;
std::for_each(names.begin(), names.end(), std::bind(boost::algorithm::to_lower<std::string>, _1, std::locale()));

但是我收到了错误:

错误C2664:'void(WritableRangeT&amp;,const std :: locale&amp;)':无法将参数1从'boost :: arg'转换为'std :: string&amp;'

在Visual Studio中

我做错了什么?

我是否正确地说,即使第二个参数是默认值,编译器也会将boost :: algorithm :: to_lower视为二进制文件?因此,我需要绑定。

0 个答案:

没有答案