DebugWriter: Add std::vector print handler
This commit is contained in:
parent
32bb18d93f
commit
2d30301aef
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
/* A cheap replacement for qDebug() */
|
/* A cheap replacement for qDebug() */
|
||||||
|
|
||||||
|
@ -44,6 +45,15 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
Debug &operator<<(const std::vector<T> &v)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < v.size(); ++i)
|
||||||
|
buf << v[i] << " ";
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
~Debug()
|
~Debug()
|
||||||
{
|
{
|
||||||
std::clog << buf.str() << std::endl;
|
std::clog << buf.str() << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue