queue<T, Sequence>
Categories: containers, adaptors
Component type: type
A
int main() {
queue<int> Q;
Q.push(8);
Q.push(7);
Q.push(6);
Q.push(2);
assert(Q.size() == 4);
assert(Q.back() == 2);
assert(Q.front() == 8);
Q.pop();
assert(Q.front() == 7);
Q.pop();
assert(Q.front() == 6);
Q.pop();
assert(Q.front() == 2);
Q.pop();
assert(Q.empty());
}
Defined in the standard header queue, and in the nonstandard backward-compatibility header stack.h.
| Parameter | Description | Default |
|---|---|---|
T | The type of object stored in the queue. | |
Sequence | The type of the underlying container used to implement the queue. | deque<T> |
Assignable, Default Constructible
• If
• If
None.
| Member | Where defined | Description |
|---|---|---|
value_type | queue | See below. |
size_type | queue | See below. |
queue() | Default Constructible | The default constructor. Creates an empty |
queue(const queue&) | Assignable | The copy constructor. |
queue& operator=(const queue&) | Assignable | The assignment operator. |
