A different approach would be to allocate the Maximum amount of space
you would ever need.
-
Would nicely solve the slicing problem.
-
Would often allocate unused space.
-
Maximum amount of space not known until all classes have been seen.
-
For this reason, not used in practice.