首页 > TAG信息列表 > MyComp
C++ 函数类型和函数指针类型的自动推导、声明和赋值
1.函数类型推导 #include <iostream> bool MyComp(int val1, int val2) { return val1 > val2; } int main() { decltype(MyComp) fun2; fun2 = MyComp; } error: non-object type 'decltype(MyComp)' (aka 'bool (int, int)') is not