c++ - What are the advantages of using consteval instead of constexpr . . . As such, consteval doesn't have much purpose at the moment It gets used in a few places like source_location::current() , which fundamentally makes no sense to execute at runtime But ultimately, the feature is a necessary building-block for further compile-time programming tools that don't exist yet
c++ - What are the advantages of using constexpr instead of consteval . . . consteval should only be used for things that must be evaluated at compile time Some examples from the C++ standard library are: Some examples from the C++ standard library are: std::source_location::current - The location in the source file cannot be obtained at run-time