Debug only code for printing vectors.

This commit is contained in:
King_DuckZ 2014-03-24 00:28:21 +01:00
parent 108c10883a
commit 8af4e432e7

View file

@ -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