35864e38fa
A slot map is a linear container similar to a vector but the indices contain are invalidated when the element is removed, and can not (or are very unlikely to) incidentally refer to a valid element again even if new elements are inserted. This implementation differs from allocating slot maps as it does not prefer value semantics for inserting and removing elements but rather offers a reserve and remove interface based on mutable references. This makes it easier for a user to avoid dropping any instances as any initialization and de-initialization can be freely chosen to write or swap. This is important if instances may contain costly resources such as allocations that are hard to recover. |
||
---|---|---|
.. | ||
lib.rs | ||
map.rs | ||
object.rs | ||
slice.rs | ||
slotmap.rs |