C++ int(bool) 是什么类型?

C 中可以使用 typedef int(*p)(bool) 定义一个函数指针,在 C++ 中现在可以使用 using a = int(bool) 声明一个类型

那么 a 是什么类型呢?函数类型?

阅读 2.5k
1 个回答

嗯 函数类型,p 函数指针类型 a 是函数类型

typedef int(*p)(bool);
using a = int(bool);

int test(bool b){
    return 0;
}

a* va  = test;
p vp = test;
推荐问题