Hacker News new | ask | show | jobs
by sltkr 734 days ago
Because `constexpr` was not supported in C until very recently (C23).

And `static const` by itself is not a good alternative, because constants can't be used in a lot of places, for example when declaring the size of an array.

1 comments

Constants can be used for array sizes since a lot of C standards ago, right?
They end up as a VLA which may or may not be what you want.