»
ensure_capacity
container.expanding_array.ensure_capacity
(new_capacity i32)
=>
container.this.expanding_array container.expanding_array.T[Contains abstract features]
¶0.094dev (2025-06-18 15:08:51 GIT hash 89cffc23ae669b0898a5564fefbf793fcb8e5ca7 built by fridi@fzen)
`new_capacity` and we are able to add elements without
allocating a new internal array.
This will create an `expanding_array` whose internal array
is the same of `expanding_array.this` unless the existing
capacity is less than `new_capacity` or the existing array
was already expanded using by a call to `add`.
In the latter cases, a new internal array of required capacity
will be allocated and the existing elements will be copied over.