Helper code to pretty print vectors.
This commit is contained in:
parent
ac85f96907
commit
0978206a6c
1 changed files with 25 additions and 0 deletions
25
src/vectorprettyprint.hpp
Normal file
25
src/vectorprettyprint.hpp
Normal 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
|
Loading…
Reference in a new issue