You can have constexpr objects fron consteval but you can not consume consteval within constexpr.
Why?
I thought consteval should have been some kind of "narrow" constexpr.
Please help me make a sense out of this design.
constexpr int constexpr_sqr(int n) { return n*n; }
consteval int consteval_sqr(int n) { return n*n; }
constexpr int constexpr_sqr2(int n) {
// not allowed
// return consteval_sqr(n);
// not allowed
// constexpr imm = consteval_sqr(n);
// return imm;
return constexpr_sqr(n);
}
int main() {
// while can do this
constexpr auto imm = consteval_sqr(999);
}
[LIVE]