#ifndef PRINT_HPP_
#define PRINT_HPP_

#include "print.h"

template<class T>
std::ostream &printcontainer(std::ostream &output, const T &c)
{
	typename T::const_iterator i;
	char *prefix;

	for (i = c.begin(), prefix = "["; i != c.end(); i++, prefix = ",")
		output << prefix << *i;
	output << ']';
	return (output);
}

template<class Key, class T>
std::ostream &operator<<(std::ostream &output, const std::pair<Key,T> &p)
{
	output << p.first << ':' << p.second;
	return (output);
}

template<class T>
vector<T>::vector(int n) : std::vector<T>(n)
{
}

template<class T>
vector<T>::vector(int n, const T &t) : std::vector<T>(n, t)
{
}

template<class T>
template<class InputIterator>
vector<T>::vector(InputIterator first, InputIterator last)
	: std::vector<T>(first, last)
{
}

template<class T>
std::ostream &operator<<(std::ostream &output, const vector<T> &v)
{
	return (printcontainer(output, v));
}

template<class T>
list<T>::list(int n) : std::list<T>(n)
{
}

template<class T>
std::ostream &operator<<(std::ostream &output, const list<T> &l)
{
	return (printcontainer(output, l));
}

template<class Key, class T>
std::ostream &operator<<(std::ostream &output, const map<Key,T> &m)
{
	return (printcontainer(output, m));
}

#endif // end PRINT_HPP_
