Expand description
General purpose data structures
These are simply std::vec::Vec wrappers tuned for a specific purpose,
so they are harder to misuse, or more efficient.
For example:
-
The first template argument in
Array<I, T>andStackMapping<I, T>requires to specify a type that will be used for indexing. This prevents us from accidentally using an index of the wrong type. -
If we know a good upper bound for the size of a vector we prefer to use
Array<I, T>,BoundedVector<T>orStackMapping<Key, T>as they never allocate after being constructed. -
Bounds checking can be disabled for all these vectors.
Structs§
- Array
- A contiguous non-growable array type with strongly-typed indexing.
- Bounded
Vector - A contiguous but non-growable array type, using
Vector - Stack
Mapping - A combination of a
BoundedVectorand anArray. - Vector
- A contiguous growable array type like
std::vec::Vec
Traits§
- Heap
Space - A trait for objects that can report their memory usage on the heap
- Offset
- Trait for types that can be used as an array index.
Functions§
- assert_
in_ bounds - Check if an offset is contained in a half-open range.
- format_
memory_ usage - Convert bytes to megabytes for readability.