这是我的代码
#include <iostream>
class A {
public:
int a = 0;
A(int i = 0) : a(i) {}
};
void func(A())
{
std::cout << "Hello" << std::endl;
}
int main()
{
A(*p)() = NULL;
func(p);
}
Run Code Online (Sandbox Code Playgroud)
让我感到困惑的是,A()in void func(A())等于A (*)()而不是A的构造函数。这是如何运作的?
c++ ×1