[ create a new paste ] login | about

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

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

using namespace std;

template <class A>
class CPrinter
{
public:
	CPrinter(A deq) {
		copy(deq.begin(), deq.end(), ostream_iterator<int>(cout, " "));
	}
};

int main()
{
	deque<int> deq;
	for (int i=0; i<10; i++) deq.push_back(i);
	CPrinter<deque<int>> p(deq);
	return 0;
}


Output:
1
2
3
In function 'int main()':
Line 21: error: '>>' should be '> >' within a nested template argument list
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: