Class Stacks
Functions for working with stacks.
Inheritance
System.Object
Stacks
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Virtlink.Utilib.Collections
Assembly: Virtlink.Utilib.dll
Syntax
public static class Stacks
Methods
| Improve this Doc View SourcePeekOrDefault<T>(Stack<T>)
Returns the top element of the stack without removing it; or returns the default value when the stack is empty.
Declaration
public static T PeekOrDefault<T>(this Stack<T> stack)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Stack<T> | stack | The stack. |
Returns
Type | Description |
---|---|
T | The top element of the stack;
or the default value of |
Type Parameters
Name | Description |
---|---|
T | The type of elements. |
PushRange<T>(Stack<T>, IEnumerable<T>)
Pushes a range of elements onto the stack.
Declaration
public static void PushRange<T>(this Stack<T> stack, IEnumerable<T> elements)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Stack<T> | stack | The stack. |
System.Collections.Generic.IEnumerable<T> | elements | The elements to push. |
Type Parameters
Name | Description |
---|---|
T | The type of elements. |
Remarks
The first element is pushed first.