Hacker News new | ask | show | jobs
by lbhdc 422 days ago
Good catch. Its weird that it compiles without error as a consteval func.
1 comments

Hmm, looking at cppreference:

The consteval specifier declares a function or function template to be an immediate function, that is, every potentially-evaluated call to the function must (directly or indirectly) produce a compile time constant expression.

It's possible that the compiler just doesn't bother as long as you aren't actually calling the function.