Can you have constexpr rvalues, e.g. when initializing variables using the result of several constexpr functions?
i.e. can I guarantee that an rvalue is computed at compile time regardless of compiler settings?
constexpr int getvalue1()
{
return 42;
}
constexpr int getvalue2()
{
return 24;
}
int main()
{
// I want to initialize val with a value known at compile time
constexpr int ceval = getvalue1() + getvalue2();
int val = ceval;
// why can't I just do:
//
// int val = constexpr getvalue1() + constexpr getvalue2();
}