How to understand the sentence “full-expression must be a constant expression” which mentioned in the standard

大城市里の小女人 提交于 2020-05-30 08:27:07

问题


Ago, Some rules in the standard that say they are applied to expression, I was confused about whether these rules can also be applied to full-expression arbitrarily. I get an answers in that question. However, there are some rules like "the full-expression of the initialization shall be a constant expression. " in the standard. Such as:
dcl.constexpr#9
basic.start.static#2

They all say that the full-expression must be a constant expression in these above links.
The prior condition for a constant expression is it must be a core constant expression. We know these rules in expr.const#2 are applied to expression, not to full-expression.

An expression e is a core constant expression unless the evaluation of e, following the rules of the abstract machine, would evaluate one of the following expressions:

So how to determine whether a full-expression is a constant expression? Or, the sentence in the standard means that these expressions within the full-expression all must be constant expressions?

来源:https://stackoverflow.com/questions/62078530/how-to-understand-the-sentence-full-expression-must-be-a-constant-expression-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!