내 클래스 중 하나에서 operator()가 오버로드되어 다른 멤버 함수에서 사용하고 싶습니다.멤버 함수에서 operator() 사용
class A {
public:
void operator()();
void operator()(double x);
};
void A::operator()() {
// stuff
};
void A::operator()(double x) {
// stuff with other members and x
this->operator();
};
라인 this->operator()
이 작동하지 않습니다. 난 그냥 내 클래스 A
의 멤버 함수로 정의 된 연산자를 사용하고 싶다. 내가 오류는 다음과 같습니다 Error 1 error C3867: 'A::operator()': function call missing argument list; use '&A::operator()' to create a pointer to member
대신에'(* this)()'을 (를) 사용해 보셨습니까? – dasblinkenlight
정말 고마워요! – vanna