Helper code to pretty print vectors.

This commit is contained in:
King_DuckZ 2014-02-22 17:06:43 +01:00
parent ac85f96907
commit 0978206a6c

25
src/vectorprettyprint.hpp Normal file
View file

@ -0,0 +1,25 @@
#ifndef idE31BEAEB229149038D67C6CF370AEEC9
#define idE31BEAEB229149038D67C6CF370AEEC9
#include "vector.hpp"
#if !defined(NDEBUG)
#include <iostream>
#endif
namespace cloonel {
#if !defined(NDEBUG)
template <typename T, uint32_t S>
inline std::ostream& operator<< (std::ostream& parOStream, const Vector<T, S>& parVec) {
parOStream << "<";
for (uint32_t z = 0; z < S - 1; ++z) {
parOStream << parVec[z] << ", ";
}
parOStream << parVec[S - 1] << ">";
return parOStream;
}
#endif
} //namespace cloonel
#endif