queue (STL/CLR)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at queue (STL/CLR).

The template class describes an object that controls a varying-length sequence of elements that has first-in first-out access. You use the container adapter queue to manage an underlying container as a queue.

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^.

Syntax

template<typename Value,  
    typename Container>  
    ref class queue  
        :   public  
        System::ICloneable,  
        Microsoft::VisualC::StlClr::IQueue<GValue, GContainer>  
    { ..... };  

Parameters

Value
The type of an element in the controlled sequence.

Container
The type of the underlying container.

Members

Type Definition Description
queue::const_reference (STL/CLR) The type of a constant reference to an element.
queue::container_type (STL/CLR) The type of the underlying container.
queue::difference_type (STL/CLR) The type of a signed distance between two elements.
queue::generic_container (STL/CLR) The type of the generic interface for the container adapter.
queue::generic_value (STL/CLR) The type of an element for the generic interface for the container adapter.
queue::reference (STL/CLR) The type of a reference to an element.
queue::size_type (STL/CLR) The type of a signed distance between two elements.
queue::value_type (STL/CLR) The type of an element.
Member Function Description
queue::assign (STL/CLR) Replaces all elements.
queue::back (STL/CLR) Accesses the last element.
queue::empty (STL/CLR) Tests whether no elements are present.
queue::front (STL/CLR) Accesses the first element.
queue::get_container (STL/CLR) Accesses the underlying container.
queue::pop (STL/CLR) Removes the first element.
queue::push (STL/CLR) Adds a new last element.
queue::queue (STL/CLR) Constructs a container object.
queue::size (STL/CLR) Counts the number of elements.
queue::to_array (STL/CLR) Copies the controlled sequence to a new array.
Property Description
queue::back_item (STL/CLR) Accesses the last element.
queue::front_item (STL/CLR) Accesses the first element.
Operator Description
queue::operator= (STL/CLR) Replaces the controlled sequence.
operator!= (queue) (STL/CLR) Determines if a queue object is not equal to another queue object.
operator< (queue) (STL/CLR) Determines if a queue object is less than another queue object.
operator<= (queue) (STL/CLR) Determines if a queue object is less than or equal to another queue object.
operator== (queue) (STL/CLR) Determines if a queue object is equal to another queue object.
operator> (queue) (STL/CLR) Determines if a queue object is greater than another queue object.
operator>= (queue) (STL/CLR) Determines if a queue object is greater than or equal to another queue object.

Interfaces

Interface Description
ICloneable Duplicate an object.
IQueue<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 just pushing the first element and popping the last element, implementing a first-in first-out queue (also known as a FIFO queue, or simply a queue).

Requirements

Header: <cliext/queue>

Namespace: cliext

See Also

deque (STL/CLR)
list (STL/CLR)
priority_queue (STL/CLR)
stack (STL/CLR)
vector (STL/CLR)
STL/CLR Library Reference