deque - STL C++

deque<X, A>::size_type

Declaration

typedef size_t deque<X, A>::size_type;

Description

This is a type definition of the data type size_type for the deque class template. This is used to define the type that specifies the size of the deque.

Header Include

#include <deque>

Example

#include <iostream>
#include <deque>

int main()
{
	using namespace std;

	// Create a deque and add four elements to it
	deque<int> qDeque;
	qDeque.push_back(5);
	qDeque.push_back(101);
	qDeque.push_back(-4);
	qDeque.push_back(32);

	// Get the number of elements in the deque and output it
	deque<int>::size_type qSize = qDeque.size();
	cout << "The size is " << qSize << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

deque<X, A>::size_type Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.