Mojo struct
List
struct List[T: CollectionElement, hint_trivial_type: Bool = False]
The List
type is a dynamically-allocated list.
It supports pushing and popping from the back resizing the underlying storage as needed. When it is deallocated, it frees its memory.
Parameters
- T (
CollectionElement
): The type of the elements. - hint_trivial_type (
Bool
): A hint to the compiler that the type T is trivial. It's not mandatory, but if set, it allows some optimizations.