If the expression can be verified as a constant, then a constant expression (which is available for optimization) is used.
如果发现表达式是常量,那么就使用可以优化的常量表达式。
Extract constant is similar to Extract Local Variable, but you must select a static, constant expression, which the refactoring will convert to a static final constant.
ExtractConstant与ExtractLocalVariable相似,但是您必须选择静态常量表达式,重构工具将会把它转换成静态的final常量。
So we have to use an integral constant expression.
所以我们要使用整型常量表达式。
Why using constant expression as a template parameter?
为什么使用常数表达式作为一个模板参数?
The default value for an optional parameter must be a constant expression.
可选参数的默认值必须是一个常数表达式。
For example, the initializer of an enumerator must be a constant expression.
例如,枚举成员的初始化式必须是常量表达式。
The address of a thread local object is not considered constant, and any expression involving such an address is not considered a constant expression.
不将线程本地对象的地址视为常数,并且涉及此类地址的任何表达式都不视为常数。
A constant-expression is an expression that can be fully evaluated at compile-time.
常量表达式是可在编译时可完全计算的表达式。
A constant-expression is an expression that can be fully evaluated at compile-time.
常量表达式是可在编译时可完全计算的表达式。
应用推荐