[ create a new paste ] login | about

Link: http://codepad.org/KdrBX7Ez    [ raw code | output | fork ]

hecomi - C++, pasted on Jun 29:
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

int main()
{
	deque<int> l;
	front_insert_iterator< deque<int> > iit(l);
	*iit = 10;
	*iit = 20;
	*iit = 30;

	back_inserter(l) = 40;
	front_inserter(l) = 50;

	deque<int>::iterator it = l.end();
	it -= 2;
	inserter(l, it) = 60;

	copy(l.begin(), l.end(), ostream_iterator<int>(cout, " "));

	return 0;
}


Output:
1
50 30 20 60 10 40 


Create a new paste based on this one


Comments: