I am looking to make a SmallArray which is like StaticArray but more mutable. It will have size and grow but not reallocate memory. It seems like StaticArray is special in the say the compiler treats it.
adding a buffer
setup types and capacity
Is there a way to have a struct and setup a buffer on the stack to store elements in for a SmallArray type container.
If you know the size that the array will end up being, is there a reason to not just do like Array(Int32).new 123? This would set the internal capacity to store 123 items. It ofc wouldn’t prevent it from allocating more if you add more elements than was expected. But that may be okay depending on your exact use case?