diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stream_support.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stream_support.h b/lib/stream_support.h index d71356c..423c7d4 100644 --- a/lib/stream_support.h +++ b/lib/stream_support.h @@ -17,14 +17,14 @@ concept NonStringIterableCollection namespace std { std::ostream & - operator<<(std::ostream & s, const NonStringIterableCollection auto & v) + operator<<(std::ostream & s, const NonStringIterableCollection auto & collection) { s << '('; - for (const auto & i : v) { - if (&i != &*v.begin()) { + for (size_t nth {}; const auto & element : collection) { + if (nth++) { s << ", "; } - s << i; + s << element; } return s << ')'; } |