From 2d30301aef2436ef824e6ecf837bae71218447aa Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Wed, 21 May 2014 18:10:46 +0200 Subject: [PATCH] DebugWriter: Add std::vector print handler --- src/debugwriter.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/debugwriter.h b/src/debugwriter.h index 27244d1..c7b10ed 100644 --- a/src/debugwriter.h +++ b/src/debugwriter.h @@ -24,6 +24,7 @@ #include #include +#include /* A cheap replacement for qDebug() */ @@ -44,6 +45,15 @@ public: return *this; } + template + Debug &operator<<(const std::vector &v) + { + for (size_t i = 0; i < v.size(); ++i) + buf << v[i] << " "; + + return *this; + } + ~Debug() { std::clog << buf.str() << std::endl;