Different compilers return different results! For more information, see:
Http://www.cppblog.com/smagle/archive/2010/05/14/115286.html
/** File: Main. CPP * Author: Vicky. H * Email: eclipser@163.com */# include <iostream> # include <typeinfo> Class A {}; void fun1 () {// fvve F indicates function 1st V indicates function return void 2nd V indicates parameter void e indicates end ends STD: cout <"function" <STD :: endl;} const A * fun2 (INT, double, const int *, const double &) {return 0;}/***/INT main (void) {// typeid (/** can be a class, struct, common object type, object, pointer, function, function pointer, Int, double, and other data types */) // if n is returned, it indicates that the parameter is a class, struct, or public object. For example, 1a 4 Base indicates that a and base are classes, struct or public body // return PL start to indicate that the parameter is a class, struct, pointer object of the public body // return F Start to indicate that the parameter is a function, and the second return value is the return type of the function, then the parameter is the function transfer parameter type. e indicates the end. // fpk1aidpkirkde F indicates that the parameter is a function, P indicates a pointer, r indicates a reference, and K indicates a const, pk1a indicates that the return value is const a *, Id indicates that the function parameters are int and double, and PKI indicates that the parameter is const int *, rkd indicates that the parameter is const double & E, indicating end // then the function is const A * F (INT, double, const int *, const double &) {} // If PF is returned, the parameter indicates the function pointer STD: cout <typeid (INT ). name () <STD: Endl; STD: cout <typeid (const INT ). name () <STD: Endl; STD: cout <typeid (const Int &). name () <STD: Endl; STD: cout <typeid (double ). name () <STD: Endl; STD: cout <typeid (const double ). name () <STD: Endl; STD: cout <typeid (const double &). name () <STD: Endl; STD: cout <typeid (). name () <STD: Endl; STD: cout <typeid (const ). name () <STD: Endl; STD: cout <typeid (const &). name () <STD: Endl; STD: cout <"-------------------------" <STD: Endl; A; STD: cout <typeid (). name () <STD: Endl; STD: cout <typeid (). _ is_function_p () <STD: Endl; STD: cout <typeid (). _ is_pointer_p () <STD: Endl; STD: cout <"-------------------------" <STD: Endl; STD: cout <typeid (). name () <STD: Endl; STD: cout <typeid (). _ is_function_p () <STD: Endl; STD: cout <typeid (). _ is_pointer_p () <STD: Endl; STD: cout <"-------------------------" <STD: Endl; STD: cout <typeid (& ). name () <STD: Endl; STD: cout <typeid (& ). _ is_function_p () <STD: Endl; STD: cout <typeid (& ). _ is_pointer_p () <STD: Endl; STD: cout <"-------------------------" <STD: Endl; STD: cout <typeid (fun1 ). name () <STD: Endl; STD: cout <typeid (fun1 ). _ is_function_p () <STD: Endl; STD: cout <typeid (fun1 ). _ is_pointer_p () <STD: Endl; STD: cout <"-------------------------" <STD: Endl; STD: cout <typeid (fun2 ). name () <STD: Endl; STD: cout <typeid (fun2 ). _ is_function_p () <STD: Endl; STD: cout <typeid (fun2 ). _ is_pointer_p () <STD: Endl; STD: cout <"-------------------------" <STD: Endl; STD: cout <typeid (& fun2 ). name () <STD: Endl; STD: cout <typeid (& fun2 ). _ is_function_p () <STD: Endl; STD: cout <typeid (& fun2 ). _ is_pointer_p () <STD: Endl; return 0 ;}
I
I
I
D
D
D
1a
1a
1a
---------------------------
1a
0
0
---------------------------
1a
0
0
---------------------------
P1a
0
1
---------------------------
Fvve
1
0
---------------------------
Fpk1aidpkirkde
1
0
---------------------------
Pfpk1aidpkirkde
0
1
Run successfully (total time: 78 ms)