00001
00024 #ifndef UTIL_H
00025 #define UTIL_H
00026
00027 #include <iostream>
00028 #include <vector>
00029
00030 template <typename T>
00031 std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
00032 out << "{ ";
00033 for (typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); ++i) {
00034 out << *i << ", ";
00035 }
00036 out << "}";
00037
00038 return out;
00039 }
00040
00041 template <typename I>
00042 void printIter (std::ostream& out, I begin, I end) {
00043 out << "{ ";
00044 for (I i = begin; i != end; ++i) {
00045 out << *i << ", ";
00046 }
00047 out << "}" << std::endl;
00048 }
00049
00050 #endif