와 find_first_of 기능에 대한 오류를 제공하는 것은 오류를이진 술어 여기
est.cpp (24)을 제공하는 코드
#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;
}
이다 '구조체 시험 :: 죄수 * __ cdecl을 표준 : find_first_of (struct test :: con *, struct test :: con *, struct test :: con *, struct test :: con *, bool (__thiscall *) (struct test :: con, str uct test :: con)) ': bool (struct test :: con, struct test :: con)'에서 'bool (__thiscall *) (struct test :: con, struct test :: con)'매개 변수 5를 변환 할 수 없음 함수 이 범위의 이름이 대상 유형과 일치합니다.
(__siscall *)과 내 조건 자 함수를 변환하는 방법을 이해하지 못합니다.
멤버 함수 포인터는 함수 포인터와 다릅니다. 합리적으로 변환 할 수는 없습니다. – chris