build: switch to C++17
Change-Id: Id6217b5c993f3e4726e89773128b565e5f136bb6
diff --git a/tools/peek/ndnpoke/main.cpp b/tools/peek/ndnpoke/main.cpp
index f2a6830..a3e5ec2 100644
--- a/tools/peek/ndnpoke/main.cpp
+++ b/tools/peek/ndnpoke/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,13 +33,12 @@
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
-namespace ndn {
-namespace peek {
+namespace ndn::peek {
namespace po = boost::program_options;
static void
-usage(std::ostream& os, const std::string& program, const po::options_description& options)
+usage(std::ostream& os, std::string_view program, const po::options_description& options)
{
os << "Usage: " << program << " [options] /name\n"
<< "\n"
@@ -167,8 +166,7 @@
}
}
-} // namespace peek
-} // namespace ndn
+} // namespace ndn::peek
int
main(int argc, char* argv[])
diff --git a/tools/peek/ndnpoke/ndnpoke.cpp b/tools/peek/ndnpoke/ndnpoke.cpp
index d31a939..27feb17 100644
--- a/tools/peek/ndnpoke/ndnpoke.cpp
+++ b/tools/peek/ndnpoke/ndnpoke.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/encoding/buffer-stream.hpp>
-namespace ndn {
-namespace peek {
+namespace ndn::peek {
NdnPoke::NdnPoke(Face& face, KeyChain& keyChain, std::istream& input, const PokeOptions& options)
: m_options(options)
@@ -123,11 +122,10 @@
}
void
-NdnPoke::onRegFailure(const std::string& reason)
+NdnPoke::onRegFailure(std::string_view reason)
{
m_result = Result::PREFIX_REG_FAIL;
std::cerr << "Prefix registration failure (" << reason << ")" << std::endl;
}
-} // namespace peek
-} // namespace ndn
+} // namespace ndn::peek
diff --git a/tools/peek/ndnpoke/ndnpoke.hpp b/tools/peek/ndnpoke/ndnpoke.hpp
index 5ffd8cf..16a3795 100644
--- a/tools/peek/ndnpoke/ndnpoke.hpp
+++ b/tools/peek/ndnpoke/ndnpoke.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <ndn-cxx/util/scheduler.hpp>
-namespace ndn {
-namespace peek {
+namespace ndn::peek {
/**
* \brief options for NdnPoke
@@ -53,7 +52,7 @@
optional<time::milliseconds> timeout;
};
-class NdnPoke : boost::noncopyable
+class NdnPoke : noncopyable
{
public:
NdnPoke(Face& face, KeyChain& keyChain, std::istream& input, const PokeOptions& options);
@@ -93,7 +92,7 @@
onRegSuccess();
void
- onRegFailure(const std::string& reason);
+ onRegFailure(std::string_view reason);
private:
const PokeOptions m_options;
@@ -106,7 +105,6 @@
Result m_result = Result::UNKNOWN;
};
-} // namespace peek
-} // namespace ndn
+} // namespace ndn::peek
#endif // NDN_TOOLS_NDNPOKE_NDNPOKE_HPP