diff options
Diffstat (limited to 'Carpet/Requirements/src/util.hh')
-rw-r--r-- | Carpet/Requirements/src/util.hh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Carpet/Requirements/src/util.hh b/Carpet/Requirements/src/util.hh new file mode 100644 index 000000000..73b5faa1e --- /dev/null +++ b/Carpet/Requirements/src/util.hh @@ -0,0 +1,35 @@ +#ifndef UTIL_HH +#define UTIL_HH + +#include <iostream> +#include <vector> + +namespace Requirements { + +using namespace std; + + // taken from defs.cc and defs.hh + // Vector output + template<class T> + inline ostream& output (ostream& os, const vector<T>& v) { + os << "["; + // Do not number the elements, as this would lead to a format that + // cannot be read back in. + // int cnt=0; + for (typename vector<T>::const_iterator ti=v.begin(); ti!=v.end(); ++ti) { + if (ti!=v.begin()) os << ","; + // os << cnt++ << ":"; + os << *ti; + } + os << "]"; + return os; + } + + template<class T> + inline ostream& operator<< (ostream& os, const vector<T>& v) { + return Requirements::output(os,v); + } + +}; + +#endif |