English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
C++ Deque (Double-ended Queue)
C ++ The Deque max_size() function is a built-in function that returns the maximum number of elements that the deque container can hold.
return_type max_size();
HereThe return_type is an unsigned integer type.
It does not contain any parameters.
It returns the maximum size of the double-ended queue.
Let's see a simple example
#include <iostream> #include <deque> using namespace std; int main() { deque<int> a = {1,2,3,4,5,6}; cout << "The maximum size of the double-ended queue "a" is:"; cout << a.max_size(); return 0; }
Output:
The maximum size of the double-ended queue "a" is:4611686018427387903