// print.h - STL containers with free format printing ostream operator<<

#ifndef PRINT_H_
#define PRINT_H_

#include <iostream>
#include <vector>
#include <list>
#include <map>

// class vector - STL vector with free format printing ostream operator<<
template<class T> class vector;

// class list - STL list with free format printing ostream operator<<
template<class T> class list;

// class map - STL map with free format printing ostream operator<<
template<class Key, class T> class map;

// class vector - STL vector with free format printing ostream operator<<
template<class T>
class vector : public std::vector<T> {

public:

// vector - initialize with n elements
vector(int n = 0);

// vector - initialize with n copies of t element
vector(int n, const T &t);

// vector - initialize with element *first through *last, excluding *last
template<class InputIterator>
vector(InputIterator first, InputIterator last);

// operator<< -- free format print in square brackets; elements comma-separated
template<class FT>
friend std::ostream &operator<<(std::ostream &, const vector<FT> &);

}; // end of class vector

// class list - STL list with free format printing ostream operator<<
template<class T>
class list : public std::list<T> {

public:

// list - initialize with n elements
list(int n = 0);

// operator<< -- free format print in square brackets; elements comma-separated
template<class FT>
friend std::ostream &operator<<(std::ostream &, const list<FT> &);

}; // end of class list

// class map - STL map with free format printing ostream operator<<
template<class Key, class T>
class map : public std::map<Key,T> {

public:

// operator<< -- free format print in square brackets; elements comma-separated
template<class FKey, class FT>
friend std::ostream &operator<<(std::ostream &, const map<FKey,FT> &);

}; // end of class map

#endif // end PRINT_H_
