Can a string literal be subscripted in a constant expression?

前端 未结 2 1581
误落风尘
误落风尘 2020-12-06 05:22

This is valid, because a constexpr expression is allowed to take the value of \"a glvalue of literal type that refers to a non-volatile object defined with cons

2条回答
  •  渐次进展
    2020-12-06 05:45

    Regarding your question about #if, it was not the intent of the standards committee to increase the set of expressions which can be used in the preprocessor, and the current wording is considered to be a defect. This will be listed as core issue 1436 in the post-Kona WG21 mailing. Thanks for bringing this to our attention!

提交回复
热议问题