Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost bind compilation error

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?

like image 818
aajkaltak Avatar asked Nov 11 '09 14:11

aajkaltak


1 Answers

A::OutOfRange is a function of 4 arguments - implicit *this being the first argument, which is missing in your bind clause

like image 131
catwalk Avatar answered Nov 16 '22 11:11

catwalk