Closed kilasuelika closed 2 years ago
Hi,
Since the selling point of the library is that you can instantiate the flexclass together with a bunch of arrays with a single allocation, it is not possible to resize it. In general, you want to use flexclasses on situations where the array is only known at runtime, but no changes are expected.
However, you can resize it if you are willing to create a copy of the flexclass instance.
See the method growGraphNode
I implemented in this example: https://godbolt.org/z/qM76xYvGd
Hi,
Since the selling point of the library is that you can instantiate the flexclass together with a bunch of arrays with a single allocation, it is not possible to resize it. In general, you want to use flexclasses on situations where the array is only known at runtime, but no changes are expected.
However, you can resize it if you are willing to create a copy of the flexclass instance. See the method
growGraphNode
I implemented in this example: https://godbolt.org/z/qM76xYvGd
Now I understand what you mean. I thought possible scenrios may dramatically decerase if the array can't be resized. In my own experience, I almost never used a fixed size container. However if the user indeed use that then your library is desirable and ideal.
At most time, the size of a container is dynamic and may be modified. So can
fc:Array
be resized?