English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C++ Deque (Double-ended Queue)
C ++ The Deque pop_back() function removes the last element from the deque container and the size of the deque is reduced by one.
void pop_back();
It does not contain any parameters.
It does not return any value.
Let's see a simple example
#include <iostream> #include<deque> using namespace std; int main() { deque<int> d={1,2,3,4,5}; deque<int>::iterator itr; d.pop_back(); for(itr=d.begin();itr!=d.end();++itr) cout <<*itr << " "; return 0; }
Output:
1 2 3 4
In this example, the pop_back() function removes the last element from the deque, that is5.