Does static constexpr variable inside a function make sense?
If I have a variable inside a function (say, a large array), does it make sense to declare it both static and constexpr ? constexpr guarantees that the array is created at compile time, so would the static be useless? void f() { static constexpr int x [] = { // a few thousand elements }; // do something with the array } Is the static actually doing anything there in terms of generated code or semantics? rici The short answer is that not only is static useful, it is pretty well always going to be desired. First, note that static and constexpr are completely independent of each other. static