The OpenD Programming Language

SList

Single-linked allocator-backed list.

Constructors

this
this()

No default construction if an allocator must be provided.

this
this(Allocator allocator)

Use the given allocator for allocations.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Postblit

this(this)
this(this)

Disable copying.

Members

Aliases

insert
alias insert = insertFront
insertAnywhere
alias insertAnywhere = insertFront
put
alias put = insertFront

Inserts an item at the front of the list.

Functions

back
auto back()

Complexity: O(length)

clear
void clear()

Removes all elements from the range

empty
bool empty()

Complexity: O(1)

front
auto front()

Complexity: O(1)

insertFront
void insertFront(T t)

Inserts an item at the front of the list.

length
size_t length()

Complexity: O(1)

moveFront
T moveFront()

Removes the first item in the list.

opOpAssign
void opOpAssign(T t)

Supports list ~= item syntax

opSlice
auto opSlice()

Forward range interface

popFront
void popFront()

Removes the first item in the list.

remove
bool remove(V value)

Removes the first instance of value found in the list.

Parameters

T

the element type

Allocator

the allocator to use. Defaults to Mallocator.

supportGC

true if the container should support holding references to GC-allocated memory.

Meta