Debug only code for printing vectors.
This commit is contained in:
parent
108c10883a
commit
8af4e432e7
1 changed files with 17 additions and 0 deletions
|
@ -24,6 +24,10 @@
|
|||
#include <ciso646>
|
||||
#include <type_traits>
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
namespace cloonel {
|
||||
template <typename T, uint32_t S>
|
||||
class Vector {
|
||||
|
@ -111,6 +115,19 @@ namespace cloonel {
|
|||
typedef Vector<float, 2> float2;
|
||||
typedef Vector<uint16_t, 2> ushort2;
|
||||
typedef Vector<int32_t, 2> int2;
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
template <typename T, uint32_t S>
|
||||
std::ostream& operator<< ( std::ostream& parStream, const Vector<T, S>& parVector ) {
|
||||
parStream << "<";
|
||||
for (uint32_t z = 0; z < S - 1; ++z) {
|
||||
parStream << parVector[z] << ",";
|
||||
}
|
||||
parStream << parVector[S - 1] << ">";
|
||||
return parStream;
|
||||
}
|
||||
#endif
|
||||
|
||||
} //namespace cloonel
|
||||
#include "vector.inl"
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue