stack (STL/CLR)
The template class describes an object that controls a varying-length sequence of elements that has last-in first-out access. You use the container adapter stack to manage an underlying container as a push-down stack.
In the description below, GValue is the same as Value unless the latter is a ref type, in which case it is Value^. Similarly, GContainer is the same as Container unless the latter is a ref type, in which case it is Container^.
template<typename Value,
typename Container>
ref class stack
: public
System::ICloneable,
Microsoft::VisualC::StlClr::IStack<GValue, GContainer>
{ ..... };
Parameters
Value
The type of an element in the controlled sequence.Container
The type of the underlying container.
Members
Type Definition |
Description |
---|---|
The type of a constant reference to an element. |
|
The type of the underlying container. |
|
The type of a signed distance between two elements. |
|
The type of the generic interface for the container adapter. |
|
The type of an element for the generic interface for the container adapter. |
|
The type of a reference to an element. |
|
The type of a signed distance between two elements. |
|
The type of an element. |
Member Function |
Description |
---|---|
Replaces all elements. |
|
Tests whether no elements are present. |
|
Accesses the underlying container. |
|
Removes the last element. |
|
Adds a new last element. |
|
Counts the number of elements. |
|
Constructs a container object. |
|
Accesses the last element. |
|
Copies the controlled sequence to a new array. |
Property |
Description |
---|---|
Accesses the last element. |
Operator |
Description |
---|---|
Replaces the controlled sequence. |
|
Determines if a stack object is not equal to another stack object. |
|
Determines if a stack object is less than another stack object. |
|
Determines if a stack object is less than or equal to another stack object. |
|
Determines if a stack object is equal to another stack object. |
|
Determines if a stack object is greater than another stack object. |
|
Determines if a stack object is greater than or equal to another stack object. |
Interfaces
Interface |
Description |
---|---|
Duplicate an object. |
|
IStack<Value, Container> |
Maintain generic container adapter. |
Remarks
The object allocates and frees storage for the sequence it controls through an underlying container, of type Container, that stores Value elements and grows on demand. The object restricts access to pushing and popping just the last element, implementing a last-in first-out queue (also known as a LIFO queue, or stack).
Requirements
Header: <cliext/stack>
Namespace: cliext
See Also
Reference
Other Resources
Change History
Date |
History |
Reason |
---|---|---|
December 2008 |
Added link to parent. |
Customer feedback. |