gpt4 book ai didi

c++ - `core constant expression` 与 `constant expression`

转载 作者:行者123 更新时间:2023-11-30 05:34:04 25 4
gpt4 key购买 nike

核心常量表达式的定义取决于常量表达式的概念,如要点 (2.7.1) 和 (2.9.1) 所示N4140 的。

§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

常量表达式的定义依赖于核心常量表达式的概念,如N4140的§5.19/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:
...

这似乎违背了数理逻辑的基本原则。

最佳答案

定义是相互递归的,但实际上不是循环的。

关于c++ - `core constant expression` 与 `constant expression`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34448254/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com