Here is the code
#include <string>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
class test {
struct con {
string s1;
string s2;
};
public:
void somefunc();
private:
bool pred(con c1, con c2);
vector<con> vec;
};
void test::somefunc()
{
vector<con> v;
vector<con>::iterator it = find_first_of(vec.begin(), vec.end(), v.begin(), v.end(), pred);
}
bool test::pred(con c1, con c2)
{
return 0;
}
it gives error
est.cpp(24) : error C2664: 'struct test::con *__cdecl std::find_first_of(struct test::con *,struct test::con *,struct test::con *,struct test::con *,bool (__thiscall *)(struct test::con,str uct test::con))' : cannot convert parameter 5 from 'bool (struct test::con,struct test::con)' to 'bool (__thiscall *)(struct test::con,struct test::con)' None of the functions with this name in scope match the target type
I don't understand what is (__thiscall*) and how to convert my predicate function to it.