by mauvia · 2y ago · 0 comments
> Array: Implements a dynamic array similar to std::array in C++.
should read "static array". std::array requires you to state the size.
C++ std::arrays are pretty much just uniformly typed tuple structures, not dynamic arrays.
In fact you can use them directly on the stack with no memory allocations whatsoever.
The documentation is correct regarding what c_std has actually implemented. And it's still useful, unlike vector the size is (dynamically) set once at construction and then enforced.
int array[N];
is one.(Your example can go on the stack. A struct with a final array member of unspecified size can work as an abstract data structure. But you can't have both at once.)
I don't remember exactly what but I have run into it before, I think the iterator implementation is a raw pointer and that breaks the interface expectations a bit?