"configs/vscode:/vscode.git/clone" did not exist on "d4af31bab4668138b77d379f30877bea17d88c2c"
Commit 9e696586 authored by Adam Osewski's avatar Adam Osewski
Browse files

Add some utilities.

parent ffc45db7
...@@ -33,9 +33,10 @@ std::ostream& LogRange(std::ostream& os, Range&& range, std::string delim) ...@@ -33,9 +33,10 @@ std::ostream& LogRange(std::ostream& os, Range&& range, std::string delim)
} }
template <typename T, typename Range> template <typename T, typename Range>
std::ostream& LogRangeAsType(std::ostream& os, Range&& range, std::string delim) std::ostream& LogRangeAsType(std::ostream& os, Range&& range, std::string delim, int row_size = 16)
{ {
bool first = true; bool first = true;
int col = 0;
for(auto&& v : range) for(auto&& v : range)
{ {
if(first) if(first)
...@@ -43,6 +44,8 @@ std::ostream& LogRangeAsType(std::ostream& os, Range&& range, std::string delim) ...@@ -43,6 +44,8 @@ std::ostream& LogRangeAsType(std::ostream& os, Range&& range, std::string delim)
else else
os << delim; os << delim;
os << static_cast<T>(v); os << static_cast<T>(v);
if((++col % row_size) == 0)
os << "\n";
} }
return os; return os;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment