Stack<T> Class

A last-in-first-out container of elements implemented as a List .

Pushing an element to the top of the stack takes amortized constant time. Popping an element from the top of the stack is O(1) operation.

Template Parameters

T

Constraint

T  is  Semiregular

Member Functions

public inline nothrow void Clear()
public inline nothrow long Count() const
public inline nothrow bool IsEmpty() const
public inline T Pop()
public inline void Push(T&& item)
public inline void Push(const T& item)
public inline nothrow T& Top()
public inline nothrow const T& Top() const

Typedefs

public typedef ValueType T

Member Variables

private List<T> items

Member Function Details

Clear Member Function

public inline nothrow void Clear()

Definition
Line 43 of System.Base/Stack.cm


Count Member Function

public inline nothrow long Count()

Definition
Line 19 of System.Base/Stack.cm


IsEmpty Member Function

public inline nothrow bool IsEmpty()

Definition
Line 15 of System.Base/Stack.cm


Pop Member Function

public inline T Pop()

Constraint
T  is  Movable
Definition
Line 31 of System.Base/Stack.cm


Push Member Function

public inline void Push(T&& item)

Constraint
T  is  Movable
Definition
Line 27 of System.Base/Stack.cm


Push Member Function

public inline void Push(const T& item)

Constraint
T  is  Copyable
Definition
Line 23 of System.Base/Stack.cm


Top Member Function

public inline nothrow T& Top()

Definition
Line 39 of System.Base/Stack.cm


Top Member Function

public inline nothrow const T& Top()

Definition
Line 35 of System.Base/Stack.cm