template <SizeOrder>
class SizeTracker
SizeTracker is a partially specialized internal class used to track (or
explicitly to not track) the size of Lists in the fidl::internal_wavl:: containers. Its
behavior and size depends on the SizeOrder template parameter passed to it.
Please note that to use this class, containers must (sadly) derive from it, they
cannot simply encapsulate it. The SizeOrder::N version of the tracker is
nominally of 0 size, however 0 sized members of a struct/class are not allowed
in C++. Attempting to put a 0 sized member into a class results in at least
1 byte of size impact, which changes the size of the entire object.
0 sized base classes, however, are totally fine. So, if we encapsulate a
SizeTracker
<SizeOrder
::N>, then our container gets bigger for no reason, but
if we derive from one, then our container stays the size that we expect it
to.
static_assert tests for this exist in the non-sized doubly and singly linked
list tests.