Fix bug in print list function
This commit is contained in:
parent
09f4ed7fd7
commit
179ab3eb9b
|
@ -14,10 +14,13 @@
|
|||
|
||||
template <typename Iterable>
|
||||
static std::ostream &PrintList(std::ostream &out, const Iterable &list) {
|
||||
auto it = list.begin();
|
||||
out << '[' << *it;
|
||||
for (++it; it != list.end(); ++it) {
|
||||
out << ", " << *it;
|
||||
out << '[';
|
||||
if (!list.empty()) {
|
||||
auto it = list.begin();
|
||||
out << *it;
|
||||
for (++it; it != list.end(); ++it) {
|
||||
out << ", " << *it;
|
||||
}
|
||||
}
|
||||
out << ']';
|
||||
return out;
|
||||
|
|
Loading…
Reference in New Issue