View source code Display the source code in std/container/dlist.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Struct std.container.dlist.DList

Implements a doubly-linked list.

DList uses reference semantics.

Properties

Name Type Description
back [get] inout(T) Forward to opSlice().back.
dup [get] DList Duplicates the container. The elements themselves are not transitively duplicated.
empty [get] bool Property returning true if and only if the container has no elements.
front [get] inout(T) Forward to opSlice().front.

Methods

Name Description
clear Removes all contents from the DList.
linearRemove linearRemove functions as remove, but also accepts ranges that are result the of a take operation. This is a convenient way to remove a fixed amount of elements from the range.
linearRemove Removes all elements belonging to r, which must be a range obtained originally from this container.
opSlice Returns a range that iterates over all elements of the container, in forward order.
remove Removes all elements belonging to r, which must be a range obtained originally from this container.
removeAny Picks one value in an unspecified position in the container, removes it from the container, and returns it. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
removeBack Removes the value at the front/back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
removeBack Removes howMany values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove howMany elements. Instead, if howMany > n, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
removeFront Removes the value at the front/back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
removeFront Removes howMany values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove howMany elements. Instead, if howMany > n, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.

Inner structs

Name Description
Range Defines the container's primary range, which embodies a bidirectional range.

Aliases

Name Description
insert Inserts stuff to the front/back of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableInsert Inserts stuff to the front/back of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableInsertAfter Inserts stuff after range r, which must be a non-empty range previously extracted from this container.
stableInsertBack Inserts stuff to the front/back of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableInsertBefore Inserts stuff after range r, which must be a non-empty range previously extracted from this container.
stableInsertFront Inserts stuff to the front/back of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableLinearRemove linearRemove functions as remove, but also accepts ranges that are result the of a take operation. This is a convenient way to remove a fixed amount of elements from the range.
stableRemove linearRemove functions as remove, but also accepts ranges that are result the of a take operation. This is a convenient way to remove a fixed amount of elements from the range.
stableRemoveAny Picks one value in an unspecified position in the container, removes it from the container, and returns it. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableRemoveBack Removes howMany values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove howMany elements. Instead, if howMany > n, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableRemoveBack Removes the value at the front/back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableRemoveFront Removes howMany values at the front or back of the container. Unlike the unparameterized versions above, these functions do not throw if they could not remove howMany elements. Instead, if howMany > n, all elements are removed. The returned value is the effective number of elements removed. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
stableRemoveFront Removes the value at the front/back of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.

Templates

Name Description
insertAfter Inserts stuff after range r, which must be a non-empty range previously extracted from this container.
insertBack Inserts stuff to the front/back of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
insertBefore Inserts stuff after range r, which must be a non-empty range previously extracted from this container.
insertFront Inserts stuff to the front/back of the container. stuff can be a value convertible to T or a range of objects convertible to T. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated.
opBinary Returns a new DList that's the concatenation of this and its argument rhs.
opBinaryRight Returns a new DList that's the concatenation of the argument lhs and this.
opEquals Comparison for equality.
opOpAssign Appends the contents of the argument rhs into this.
this Constructor taking a number of nodes
this Constructor taking an input range

Authors

Steven Schveighoffer, Andrei Alexandrescu

License

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at ).

Comments