deque - STL C++

deque<X, A>::const_reverse_iterator

Declaration

typedef (unspecified) deque<X, A>::const_reverse_iterator;

Description

This is a type definition of the data type const_reverse_iterator for the deque class template. This type is used to sequentially access elements in the reverse order with respect to the deque container without allowing the elements to be changed.

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);

	// Use the reverse iterator to access and output the elements
	deque<int>::const_reverse_iterator qIter;
	for (qIter = qDeque.rbegin(); qIter != qDeque.rend(); ++qIter) {
		cout << "Deque entry = " << *qIter << endl;
	}

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

Output

deque<X, A>::const_reverse_iterator Output
 

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