Explain what consteval and constinit bring to C++?
Show answer and explanation
consteval declares an immediate function whose potentially evaluated calls must produce a compile-time constant. constinit applies to static or thread storage and requires static initialization, but it does not make the object immutable.
consteval declares an immediate function whose potentially evaluated calls must produce a compile-time constant. constinit applies to static or thread storage and requires static initialization, but it does not make the object immutable.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.