Closed
Description
Many C++ projects (including all web browser engines that I am aware of, LLVM, etc.) use their own C++ collections where collections have an inline capacity specified at compile time, e.g. Vec<T, 4>
. This means that the collection reserves space for a fixed number of elements, and it until its capacity goes above the inline capacity it can avoid a heap allocation.
Obviously, this feature requires support for type-level integers in the first place. It also increases the pressure to deal with existing ergonomic issues regarding type constructor parameters, since e.g. HashMap
would have key, value, hasher, inline capacity, and allocator parameters.