//old void *p = NULL; int (*x)(double) = (int (*)(double)) p; // This is legal int (*)(double) y = (int (*)(double)) p; // Left-hand side is not legal int (*z)(double) = (int (*p)(double)); // Right-hand side is not legal
//new typedefint(*funcptr)(double); // pointer to function taking a double returning int funcptr x = (funcptr) NULL; // C or C++ funcptr y = funcptr(NULL); // C++ only funcptr z = static_cast<funcptr>(NULL); // C++ only
#if 0 structStructWithBarAsValue { int bar; }; #endif
intmain(){ StructWithBarAsType x; foo(x); }
output
错误 C3861 “p”: 找不到标识符
A name used in a template declaration or definition and that is dependent on a template-parameter is assumed not to name a type unless the applicable name lookup finds a type name or the name is qualified by the keyword typename.