build: switch to C++17
Change-Id: Id6217b5c993f3e4726e89773128b565e5f136bb6
diff --git a/tools/dump/ndndump.cpp b/tools/dump/ndndump.cpp
index cb1583f..4b28c63 100644
--- a/tools/dump/ndndump.cpp
+++ b/tools/dump/ndndump.cpp
@@ -39,8 +39,7 @@
#include <boost/endian/conversion.hpp>
-namespace ndn {
-namespace dump {
+namespace ndn::dump {
namespace endian = boost::endian;
@@ -517,9 +516,7 @@
}
out.addDelimiter();
- bool isOk = false;
- Block block;
- std::tie(isOk, block) = Block::fromBuffer({pkt, len});
+ auto [isOk, block] = Block::fromBuffer({pkt, len});
if (!isOk) {
// if packet is incomplete, we will not be able to process it
out << "NDN truncated packet, length " << len;
@@ -539,15 +536,12 @@
return true;
}
- Buffer::const_iterator begin, end;
- if (lpPacket.has<lp::FragmentField>()) {
- std::tie(begin, end) = lpPacket.get<lp::FragmentField>();
- }
- else {
+ if (!lpPacket.has<lp::FragmentField>()) {
out << " idle";
return true;
}
+ auto [begin, end] = lpPacket.get<lp::FragmentField>();
std::tie(isOk, netPacket) = Block::fromBuffer({begin, end});
if (!isOk) {
// if network packet is fragmented, we will not be able to process it
@@ -610,5 +604,4 @@
return std::regex_match(name.toUri(), *nameFilter);
}
-} // namespace dump
-} // namespace ndn
+} // namespace ndn::dump