-1
class A
{
public:
void operator()(int);
void operator()(const std::string&) {}
};
std::cout << typeid(&A::operator()).name() << std::endl;
그것은 오류를 제공, GCC 4.8.2에서 다음 작업을 수행 할 때 :
그것은 같은 다른 클래스 멤버 연산자 작동error: address of overloaded function with no contextual type information.
연산자 ==. 그 구문 오류 A :: operator()에 대한 typeid() 호출에 있습니까?
편집 : 죄송합니다. 이 문제는 여러 개의 오버로드 된 operator()가있을 때 발생합니다.
는 [나를 위해 일]로 보인다 (http://rextester.com/PFM1036) –
는 GCC 6.2 –
죄송합니다, 내 나쁜로 재현 할 수 없습니다. 질문을 수정했습니다. 오버로드 된 operator()가 여러 개 정의되어있을 때 발생합니다. – surfcode