cpprefjp / site

cpprefjpサイトのMarkdownソース
https://cpprefjp.github.io/
381 stars 155 forks source link

[C++23] 定数式内での非リテラル変数を含むことを許可する #1038 #1223

Closed ToruNiina closed 9 months ago

ToruNiina commented 9 months ago

issueでは「含められないようにする」とのことでしたが、P2242R3を読む限り、これまで含められなかったものを含められるようにするようです。

"Proposed wording"から、

In [dcl.constexpr]/3, strike the last bullet:

~its function-body shall not enclose~

  • ~a goto statement,~
  • ~an identifier label,~
  • ~a definition of a variable of non-literal type or of static or thread storage duration.~

インラインアセンブラなどが定数式文脈で評価されないことを条件にconstexpr内に存在することを許可されたのと同様のモチベーションによる変更のようです。

ご確認ください。