boost绑定编译错误
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
有人可以告诉我我做错了什么吗?
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()
);
}
I am getting errors like:
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
Can someone tell me what I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
A::OutOfRange 是一个有 4 个参数的函数 - 隐式 *this 是第一个参数,在绑定子句中缺少该参数
A::OutOfRange is a function of 4 arguments - implicit *this being the first argument, which is missing in your bind clause