View source code
							
							
						
								Display the source code in std/container/slist.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								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.
							
						Struct std.container.slist.SList
Implements a simple and fast singly-linked list. It can be used as a stack.
						
				struct SList(T)
				
				  
				
				if (!is(T == shared));
						
					
				SList uses reference semantics.
Constructors
| Name | Description | 
|---|---|
| this | Constructor taking a number of nodes | 
| this | Constructor taking an input range | 
Properties
| Name | Type | Description | 
|---|---|---|
| dup[get] | SList | Duplicates the container. The elements themselves are not transitively duplicated. | 
| empty[get] | bool | Property returning trueif and only if the container has no
elements. | 
| front[get] | T | Forward to opSlice(). | 
Methods
| Name | Description | 
|---|---|
| clear | Removes all contents from the SList. | 
| insertAfter | Inserts stuffafter ranger, which must be a range
previously extracted from this container. Given that all ranges for a
list end at the end of the list, this function essentially appends to
the list and usesras a potentially fast way to reach the last
node in the list. Ideallyris positioned near or at the last
element of the list. | 
| insertAfter | Similar to insertAfterabove, but accepts a range bounded in
count. This is important for ensuring fast insertions in the middle of
the list.  For fast insertions after a specified positionr, useinsertAfter(take(r, 1), stuff). The complexity of that operation
only depends on the number of elements instuff. | 
| insertFront | Inserts stuffto the front of the container.stuffcan be a
value convertible toTor a range of objects convertible toT. The stable version behaves the same, but guarantees that ranges
iterating over the container are never invalidated. | 
| linearRemove | Removes a range from the list in linear time. | 
| linearRemove | Removes a Take!Rangefrom the list in linear time. | 
| linearRemoveElement | Removes the first occurence of an element from the list in linear time. | 
| opBinary | Returns a new SListthat's the concatenation ofthisand its
argument.opBinaryRightis only defined ifStuffdoes not
defineopBinary. | 
| opBinaryRight | Returns a new SListthat's the concatenation ofthisand its
argument.opBinaryRightis only defined ifStuffdoes not
defineopBinary. | 
| opEquals | Comparison for equality. | 
| opSlice | Returns a range that iterates over all elements of the container, in forward order. | 
| 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. | 
| removeFront | Removes the value at the front of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. | 
| removeFront | Removes howManyvalues at the front or back of the
container. Unlike the unparameterized versions above, these functions
do not throw if they could not removehowManyelements. Instead,
ifhowMany > 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. | 
| reverse | Reverses SList in-place. Performs no memory allocation. | 
Inner structs
| Name | Description | 
|---|---|
| Range | Defines the container's primary range, which embodies a forward range. | 
Aliases
| Name | Description | 
|---|---|
| insert | Inserts stuffto the front of the container.stuffcan be a
value convertible toTor a range of objects convertible toT. The stable version behaves the same, but guarantees that ranges
iterating over the container are never invalidated. | 
| stableInsert | Inserts stuffto the front of the container.stuffcan be a
value convertible toTor a range of objects convertible toT. The stable version behaves the same, but guarantees that ranges
iterating over the container are never invalidated. | 
| stableInsertAfter | Similar to insertAfterabove, but accepts a range bounded in
count. This is important for ensuring fast insertions in the middle of
the list.  For fast insertions after a specified positionr, useinsertAfter(take(r, 1), stuff). The complexity of that operation
only depends on the number of elements instuff. | 
| stableInsertFront | Inserts stuffto the front of the container.stuffcan be a
value convertible toTor a range of objects convertible toT. The stable version behaves the same, but guarantees that ranges
iterating over the container are never invalidated. | 
| stableLinearRemove | Removes a Take!Rangefrom the list in linear time. | 
| 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. | 
| stableRemoveFront | Removes the value at the front of the container. The stable version behaves the same, but guarantees that ranges iterating over the container are never invalidated. | 
| stableRemoveFront | Removes howManyvalues at the front or back of the
container. Unlike the unparameterized versions above, these functions
do not throw if they could not removehowManyelements. Instead,
ifhowMany > 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. | 
Authors
License
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at ).
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.