This function does not modify the content of the container in any way. To clear the content of a deque container, use deque::clear.
Parameters
noneReturn Value
true if the container size is 0, false otherwise.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
The example initializes the content of the container to a sequence of numbers (form 1 to 10). It then pops the elements one by one until it is empty and calculates their sum.
Output:
total: 55 |
Complexity
Constant.See also
| deque::clear | Clear content (public member function) |
| deque::erase | Erase elements (public member function) |
| deque::size | Return size (public member function) |
