是函数的指针运算符
下面的示例在 Visual C++ .NET 2003 中工作在该标准上指定:
// operator_that_is_pointer_to_function.cpp
// function style call on object will invoke user-defined conversion
// if there is one. See secion 13.3.1.1.2
typedef void(*ptf)();
void func()
{
}
struct S
{
operator ptf()
{
return func;
}
};
int main()
{
S s;
s();//operates as s.operator ptf()()
}