/*
  Investigate Typedef Templates workaround.

  Reference: C++ Templates - the complete guide by D.Vandevoorde and 
    N.Josuttis .

  Note that STL uses the workaround for its iterators.
*/

#include <iostream>
#include <list>
#include <vector>
using namespace std;


template< typename T >
class veclist
{
public:
  typedef vector< list< T > > type;
};


void print(veclist<int>::type & v)
{
  for (unsigned int i=0, imax=v.size(); i<imax; ++i)
  {
    list<int>::iterator k = v[i].begin();
    list<int>::iterator kend = v[i].end();
    for ( ; k!= kend; ++k)
    {
      cout << *k << endl;
    }
  }
}

void test01()
{

  veclist< int >::type x;

  list< int > y;
  y.push_back(23);
  y.push_back(32);

  x.push_back(y);

  print(x);




}


int main()
{
  test01();

  return 0;
}



