build: switch to C++17
Change-Id: Id6217b5c993f3e4726e89773128b565e5f136bb6
diff --git a/tools/dump/ndndump.hpp b/tools/dump/ndndump.hpp
index 47a455a..9d786e7 100644
--- a/tools/dump/ndndump.hpp
+++ b/tools/dump/ndndump.hpp
@@ -37,8 +37,7 @@
#define UH_LEN len
#endif
-namespace ndn {
-namespace dump {
+namespace ndn::dump {
class OutputFormatter;
@@ -59,7 +58,7 @@
void
printPacket(const pcap_pkthdr* pkthdr, const uint8_t* payload) const;
- static constexpr const char*
+ static constexpr std::string_view
getDefaultPcapFilter() noexcept
{
return "(ether proto 0x8624) or (tcp port 6363) or (udp port 6363) or (udp port 56363)";
@@ -99,13 +98,13 @@
bool
printNdn(OutputFormatter& out, const uint8_t* pkt, size_t len) const;
- bool
+ [[nodiscard]] bool
matchesFilter(const Name& name) const;
public: // options
std::string interface;
std::string inputFile;
- std::string pcapFilter = getDefaultPcapFilter();
+ std::string pcapFilter{getDefaultPcapFilter()};
optional<std::regex> nameFilter;
bool wantPromisc = true;
bool wantTimestamp = true;
@@ -118,7 +117,6 @@
int m_dataLinkType = -1;
};
-} // namespace dump
-} // namespace ndn
+} // namespace ndn::dump
#endif // NDN_TOOLS_DUMP_NDNDUMP_HPP