Which Line Refuses
constexpr int twice(int n) { return 2 * n; }
consteval int thrice(int n) { return 3 * n; }
int runtime_value(); // defined elsewhere
int main() {
constexpr int a = twice(4); // line 1
int b = twice(runtime_value()); // line 2
constexpr int c = thrice(4); // line 3
int d = thrice(runtime_value()); // line 4
}
Which lines are ill-formed?
Sign in to answer questions and track your progress
Sign In