util: backport std::experimental::ostream_joiner
Change-Id: I4d12269ac41f07d224772abc0e50039be519fdcc
Refs: #3962
diff --git a/src/mgmt/nfd/fib-entry.cpp b/src/mgmt/nfd/fib-entry.cpp
index e3633aa..db3b69f 100644
--- a/src/mgmt/nfd/fib-entry.cpp
+++ b/src/mgmt/nfd/fib-entry.cpp
@@ -269,13 +269,9 @@
os << "FibEntry(Prefix: " << entry.getPrefix() << ",\n"
<< " NextHops: [";
- bool first = true;
- for (const auto& nh : entry.getNextHopRecords()) {
- if (!first)
- os << ",\n ";
- first = false;
- os << nh;
- }
+ std::copy(entry.getNextHopRecords().begin(), entry.getNextHopRecords().end(),
+ make_ostream_joiner(os, ",\n "));
+
os << "]\n";
return os << " )";