#include <iostream> using namespace std; int main() { const double kPi = 3.14; constexpr double kPi2 = 2.0*kPi; cout << kPi2; return 0; }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:6:30: error: the value of 'kPi' is not usable in a constant expression constexpr double kPi2 = 2.0*kPi; ^ prog.cpp:5:15: note: 'kPi' was not declared 'constexpr' const double kPi = 3.14; ^
Standard output is empty