From 8af4e432e73cdcf74c1e6cbec6057d487ed4d71a Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 24 Mar 2014 00:28:21 +0100 Subject: [PATCH] Debug only code for printing vectors. --- src/vector.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/vector.hpp b/src/vector.hpp index 41dd2b8..696d92a 100644 --- a/src/vector.hpp +++ b/src/vector.hpp @@ -24,6 +24,10 @@ #include #include +#if !defined(NDEBUG) +#include +#endif + namespace cloonel { template class Vector { @@ -111,6 +115,19 @@ namespace cloonel { typedef Vector float2; typedef Vector ushort2; typedef Vector int2; + +#if !defined(NDEBUG) + template + std::ostream& operator<< ( std::ostream& parStream, const Vector& 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