This might seem the same question as What are the advantages of using consteval instead of constexpr function? but it is actually exactly the opposite:
Now that we have C++20 consteval, what are the (realistic) scenarios for which I would still need/create a constexpr function instead of consteval a function (or an ordinary function)?
I know that constexpr functions can also be called with parameters evaluated at run time, unlike consteval functions (see *** in the sample code), but why would I ever need that? I mean I can also use an ordinary function then.
int FunNormal()
{
return 12345;
}
consteval int FunConstEval(int p)
{
return p+3;
}
constexpr int FunConstExpr(int p)
{
return p+3;
}
int main()
{
// FunConstEval(FunNormal()); // illegal
FunConstExpr(FunNormal()); // legal, but why would I ever want to do this? ***
// constexpr int a1 = FunNormal(); // illegal, obviously
// constexpr int a1 = FunConstExpr(FunNormal()); // illegal
constexpr int a2 = FunConstEval(1);
constexpr int a3 = FunConstExpr(1);
}