How to create a StaticArray with a variable size?

You can’t resize the actual static array, but you can create a slice pointing to it and resize that accordingly.