IImmutableStack<T>.Peek 方法

定义

返回位于不可变堆栈顶部的元素但不将其移除。Returns the element at the top of the immutable stack without removing it.

public:
 T Peek();
public T Peek ();
abstract member Peek : unit -> 'T
Public Function Peek () As T

返回

T

位于堆栈顶部的元素。The element at the top of the stack.

异常

堆栈为空。The stack is empty.

适用于