DebugWriter: Add std::vector print handler
This commit is contained in:
parent
32bb18d93f
commit
2d30301aef
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
/* A cheap replacement for qDebug() */
|
||||
|
||||
|
@ -44,6 +45,15 @@ public:
|
|||
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()
|
||||
{
|
||||
std::clog << buf.str() << std::endl;
|
||||
|
|
Loading…
Reference in New Issue