Dynamic array + AA array

Andrea Fontana nospam at example.com
Tue Sep 17 15:51:34 UTC 2019


On Tuesday, 17 September 2019 at 14:33:30 UTC, Brett wrote:
> The idea is to basically use a dynamic array for most of the 
> items, then an array to get the rest.
>
> T[] Base;
> T[int] Rest;
>
> Then if Base has a max size(usually it might be fixed due to 
> some algorithm) the Rest AA can pick up any outside values 
> easily.
>
> The idea here is to be able to combine them as one "infinite" 
> array of T.
>
> Any indexing outside of Base gets carried in to Rest.

What if I try to read an index that was not assigned?
What if I try a foreach on it?




More information about the Digitalmars-d-learn mailing list