Store elements in a flattened representation.
A FlatBag is a data structure that stores an ordered list of elements in a flat structure, avoiding the overhead of a linked list. Use this data structure, if the code requires the following properties:
Elements are stored in a long-lived object, and benefit from a flattened representation.
The FlatBag will be traversed but not extended or filtered.
The number of elements should be known.
Sharing of the empty case improves memory behaviour.
A FlagBag aims to have as little overhead as possible to store its elements.
To achieve that, it distinguishes between the empty case, singleton, tuple
and general case.
Thus, we only pay for the additional three words of an Array if we have at least
three elements.