【发布时间】:2010-12-15 11:59:05
【问题描述】:
class A
{
bool OutofRange(string& a, string& b, string c);
void Get(vector <string>& str, string& a, string& b);
}
void A::Get(vector <string>& str, string& a, string& b)
{
str.erase(
std::remove_if (str.begin(), str.end(), BOOST_BIND(&A::OutOfRange, a, b, _1)),
str.end()
);
}
我收到如下错误:
Error 7 error C2825: 'F': must be a class or namespace when followed by '::' File:bind.hpp
Error 8 error C2039: 'result_type' : is not a member of '`global namespace'' t:\3rdparty\cpp\boost\boost-1.38.0\include\boost\bind.hpp 67
谁能告诉我我做错了什么?
【问题讨论】:
-
贴一些真实的代码。例如。
A::Get()定义缺少返回类型。 -
我在这里根据这个答案编写了我的代码::: stackoverflow.com/questions/1677211/sort-using-boostbind/…
标签: c++ boost boost-bind erase-remove-idiom