util: backport std::experimental::ostream_joiner
Change-Id: I4d12269ac41f07d224772abc0e50039be519fdcc
Refs: #3962
diff --git a/src/mgmt/nfd/rib-entry.cpp b/src/mgmt/nfd/rib-entry.cpp
index c7ec47a..315b4bd 100644
--- a/src/mgmt/nfd/rib-entry.cpp
+++ b/src/mgmt/nfd/rib-entry.cpp
@@ -348,13 +348,9 @@
os << "RibEntry(Prefix: " << entry.getName() << ",\n"
<< " Routes: [";
- bool isFirst = true;
- for (const auto& route : entry.getRoutes()) {
- if (!isFirst)
- os << ",\n ";
- isFirst = false;
- os << route;
- }
+ std::copy(entry.getRoutes().begin(), entry.getRoutes().end(),
+ make_ostream_joiner(os, ",\n "));
+
os << "]\n";
return os << " )";