Skip to main content

struct

ListLiteral

The type of a literal heterogeneous list expression.

A list consists of zero or more values, separated by commas.

Parameters

  • *Ts (Movable): The type of the elements.

Fields

  • storage (Tuple[Ts]): The underlying storage for the list.

Implemented traits

AnyType, Movable, Sized

Methods

__init__

__init__(inout self: Self, owned *args: *Ts)

Construct the list literal from the given values.

Args:

  • *args (*Ts): The init values.

__moveinit__

__moveinit__(inout self: Self, owned existing: Self)

Move construct the list.

Args:

  • existing (Self): The value to move from.

get

get[i: Int, T: Movable](self: Self) -> ref [*[0,0]] $1

Get a list element at the given index.

Parameters:

  • i (Int): The element index.
  • T (Movable): The element type.

Returns:

The element at the given index.