#include int main() { int runtime_value = 10; const int const_runtime_init = runtime_value; // OK, const_runtime_init is a const int initialized at runtime // constexpr int constexpr_runtime_init = runtime_value; // ERROR: runtime_value is not a constant expression const int const_compile_time_init = 5 ; // OK, const int initialized with a compile-time constant constexpr int constexpr_compile_time_init = 5 ; // OK, constexpr int initialized with a compile-time constant int arr1[const_compile_time_init]; // OK, const_compile_time_init is a compile-time constant int arr2[constexpr_compile_time_init]; // OK, constexpr_compile_time_init is a compile-time constant // int arr3[const_runtime_init]; // ERROR: const_runtime_init might not be a compile-time constant constexpr int array_size = 10 ; // array_size is a compile-time constant int arr[array_size]; return 0 ; }