deque - STL C++

deque<X, A>::push_front()

Declaration

void deque<X,A>::push_front(const X& kxrValue);

Description

This is the push_front() function for the deque class template.

Header Include

#include <deque>

Overloads

void deque<X,A>::push_front(X&& xrrValue);

Example

#include <iostream>
#include <deque>

int main()
{
	using namespace std;

	// Create a deque instance
	deque<char> qD;
	qD.push_front('X');
	qD.push_front('o');
	qD.push_front('a');
	qD.push_front('X');
	qD.push_front('.');
	qD.push_front('n');
	qD.push_front('e');
	qD.push_front('t');

	// Output the entries after push_front()
	deque<char>::iterator qIter;
	for (qIter = qD.begin(); qIter != qD.end(); ++qIter) {
		cout << *qIter;
	}
	cout << endl;

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

Output

deque<X, A>::push_front() Output
 

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