#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <sstream>
#include <iterator>
using namespace std;


template <typename Foo>
struct Gizmo
{
	Foo mF;
	Gizmo (Foo f) : mF (f) {};
	
	template <template <typename> class Cont> void DoIt(
		typename Cont <string>::iterator begin,
		typename Cont <string>::iterator end)
		const
		{
			stringstream ss;
			ss << "(" << this->mF << ")\n";
			const std::string s = ss.str();
			copy (begin, end, ostream_iterator <std::string> (cout, s.c_str()));
		}
};

int main()
{
	list <string> l;
	l.push_back ("Hello");
	l.push_back ("world");
	
	Gizmo <unsigned> g (42);
	g.DoIt (l.begin(), l.end());
}