What is consteval?

后端 未结 1 1748
野的像风
野的像风 2020-12-10 00:35

Apparently, consteval is going to be a keyword in C++20. The cppreference page for it is currently blank. What is it going to be and how does it relate to

相关标签:
1条回答
  • 2020-12-10 01:05

    It declares immediate functions, that is, functions that must be evaluated at compile time to produce a constant. (It used to be spelled constexpr! in a previous revision of the paper.) In contrast, constexpr functions may be evaluated at compile time or run time, and need not produce a constant in all cases.

    The adopted paper is P1073R3, which is not yet publicly available, but a previous revision is available and the introductory (motivation and high-level description) portion is about the same (except that the "Source Locations" section is deleted in R3).

    0 讨论(0)
提交回复
热议问题