在C++常量表达式的MSDN页面上说:
Nonintegral constants must be converted (either explicitly or implicitly) to integral types to be legal in a constant expression. Therefore, the following code is legal:
const double Size = 11.0; char chArray[(int)Size];
至少在VC++ 10.0上,第二行会产生“error C2057:期望常量表达式”的错误。那么在其他编译器上是否合法,还是MSDN页面简单地错误了?
final
,而这在C++中肯定是不合法的... - Billy ONeal