ImmutableInterlocked.TryPop<T>(ImmutableStack<T>, T) 方法
定义
如果有要移除的元素,则从堆栈顶部移除一个元素。Removes an element from the top of the stack, if there is an element to remove.
public:
generic <typename T>
static bool TryPop(System::Collections::Immutable::ImmutableStack<T> ^ % location, [Runtime::InteropServices::Out] T % value);
public static bool TryPop<T> (ref System.Collections.Immutable.ImmutableStack<T> location, out T value);
static member TryPop : ImmutableStack * 'T -> bool
Public Shared Function TryPop(Of T) (ByRef location As ImmutableStack(Of T), ByRef value As T) As Boolean
类型参数
- T
堆栈中项的类型。The type of items in the stack.
参数
- location
- ImmutableStack<T>
要更新的堆栈。The stack to update.
- value
- T
如果堆栈不为空,则接收已从堆栈中移除的值。Receives the value removed from the stack, if the stack is not empty.
返回
如果从堆栈中移除了一个元素,则为 true;否则为 false。true if an element is removed from the stack; otherwise, false.