So there's no way to have a fixed-size bounds-checked arrays in C as far as I know.
The *standard way* to do this in C++ is std::array which is templatized std::array<type, max_size> as in std::array<int, 6>.
With overloaded operator[] which does bounds-checks in debug (at least in MS implementation, GCC's impl doesn't do it by default I think).
DOOM-3-BFG has a
idArray which is essentially the same thing with less bullshit.
The killer question here is simple, how hard does this tank the compile times if used in the *large*?
Because for the most part, all that's ever needed is whole bunch of fixed sized arrays.
And everything else is built on top of it (open-addressed hashmaps, packedarrays, freelists).
Every new std::array<Tulip, 100> will instantiate a new template and shit out a ton of code, and in a code-base of reasonable size this will take forever to compile, right?