Difference between revisions of "cpp/container/queue"
From cppreference.com
m (Shorten template names. Use {{lc}} where appropriate.) |
|||
Line 13: | Line 13: | ||
===Template parameters=== | ===Template parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | T | The type of the stored elements.}} |
− | {{ | + | {{par | Container | The type of the underlying container to use to store the elements. The container must satisfy the requirements of {{concept|SequenceContainer}}. Additionally, it must provide the following functions with the usual semantics: |
* {{tt|back()}} | * {{tt|back()}} | ||
Line 22: | Line 22: | ||
* {{tt|pop_front()}} | * {{tt|pop_front()}} | ||
− | The standard containers {{ | + | The standard containers {{lc|std::vector}}, {{lc|std::deque}} and {{lc|std::list}} satisfy these requirements. |
− | }}{{ | + | }}{{par end}} |
===Member types=== | ===Member types=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc hitem | Member type | Definition}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list container_type | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list value_type | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list size_type | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list reference | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list const_reference | queue}} |
− | {{ | + | {{dsc end}} |
===Member functions=== | ===Member functions=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list constructor | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list destructor | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list operator{{=}} | queue}} |
− | {{ | + | {{dsc h2 | Element access}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list front | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list back | queue}} |
− | {{ | + | {{dsc h2 | Capacity}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list empty | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list size | queue}} |
− | {{ | + | {{dsc h2 | Modifiers}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list push | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list emplace | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list pop | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list swap | queue}} |
− | {{ | + | {{dsc h1 | Member objects}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list c | queue}} |
− | {{ | + | {{dsc end}} |
===Non-member functions=== | ===Non-member functions=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list operator_cmp | queue}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list swap2 | queue}} |
− | {{ | + | {{dsc end}} |
===Helper classes=== | ===Helper classes=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/container/dcl list uses_allocator | queue}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/container/queue]] | [[de:cpp/container/queue]] |
Revision as of 18:40, 31 May 2013
Defined in header <queue>
|
||
template< class T, |
||
The std::queue
class is a container adapter that gives the programmer the functionality of a queue - specifically, a FIFO (first-in, first-out) data structure.
The class template acts as a wrapper to the underlying container - only a specific set of functions is provided. The queue pushes the elements on the back of the underlying container and pops them from the front.
Contents |
Template parameters
T | - | The type of the stored elements. |
Container | - | The type of the underlying container to use to store the elements. The container must satisfy the requirements of Template:concept. Additionally, it must provide the following functions with the usual semantics:
The standard containers std::vector, std::deque and std::list satisfy these requirements. |