“核心常量表达式”与“常量表达式”
`core constant expression` vs `constant expression`
核心常量表达式的定义取决于常量表达式的概念,如要点 (2.7. N4140 的 1) 和 (2.9.1)
§5.19/2:
A conditional-expression e
is a core constant expression unless the
evaluation of e
, following the rules of the abstract machine (1.9),
would evaluate one of the following expressions:
...
(2.7.1) — a non-volatile glvalue of integral or enumeration type that
refers to a non-volatile const object with a preceding initialization,
initialized with a constant expression
...
(2.9.1) — it is initialized with a constant expression or
而一个常量表达式的定义依赖于一个核心常量表达式的概念,见§5.19/ N4140 中的 4 个:
A constant expression is either a glvalue core constant
expression whose value refers to an object with static storage
duration or to a function, or a prvalue core constant expression
whose value is an object where, for that object and its subobjects:
...
这似乎违背了数理逻辑的基本原理。
定义是相互递归的,但实际上不是循环的。
核心常量表达式的定义取决于常量表达式的概念,如要点 (2.7. N4140 的 1) 和 (2.9.1)
§5.19/2:
A conditional-expression
e
is a core constant expression unless the evaluation ofe
, following the rules of the abstract machine (1.9), would evaluate one of the following expressions:
...
(2.7.1) — a non-volatile glvalue of integral or enumeration type that refers to a non-volatile const object with a preceding initialization, initialized with a constant expression
...
(2.9.1) — it is initialized with a constant expression or
而一个常量表达式的定义依赖于一个核心常量表达式的概念,见§5.19/ N4140 中的 4 个:
A constant expression is either a glvalue core constant expression whose value refers to an object with static storage duration or to a function, or a prvalue core constant expression whose value is an object where, for that object and its subobjects:
...
这似乎违背了数理逻辑的基本原理。
定义是相互递归的,但实际上不是循环的。