阅读 TCPL 第四版时 ,遇到了如下语句,
For a function to be usable in a constant expression, that is, in an expression that will be evaluated by the compiler, it must be defined constexpr.
为了验证,我正在 VS 2013中 写出如下代码
constexpr double square(double x) { return x*x; }
可是挨千刀的VS2013 给报错。 error C2144: syntax error : 'double' should be preceded by ';'
难道说, VS2013 还不支持 constexpr?