/*
 *  vector-list-IO.h
 *
 *  Created by Bruce MacLennan on 2008/11/29.
 *
 */

#ifndef VECTORLISTIO_H_
#define VECTORLISTIO_H_
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <iterator>
using namespace std;

template <typename T> ostream& operator << (ostream& os, vector<T> & Vref) {
  typename vector<T>::const_iterator Vi;
  os << "{";
  for (Vi = Vref.begin(); Vi != Vref.end(); Vi++) {
    os << *Vi;
	if (Vi+1 != Vref.end()) os << ", ";
  }
  os << "}";
  return os;
}

template <typename T> ostream& operator << (ostream& os, list<T> Lref) {
  int i = 0;
  typename list<T>::const_iterator Li;
  os << "[";
  for (Li = Lref.begin(); Li != Lref.end(); Li++) {
    os << *Li;
	if (++i < (int) Lref.size()) os << ", ";
  }
  os << "]";
  return os;
}

#endif /* VECTORLISTIO_H_ */

