Use more C++17 features
Mainly structured bindings, inline variables, and class template
argument deduction, plus many more smaller things.
Change-Id: I810d17e0adb470426e4e30c898e03b3140ad052f
diff --git a/tools/ndn-autoconfig/main.cpp b/tools/ndn-autoconfig/main.cpp
index ecfad81..afedc38 100644
--- a/tools/ndn-autoconfig/main.cpp
+++ b/tools/ndn-autoconfig/main.cpp
@@ -46,9 +46,9 @@
namespace po = boost::program_options;
-const time::nanoseconds DAEMON_INITIAL_DELAY = 100_ms;
-const time::nanoseconds DAEMON_UNCONDITIONAL_INTERVAL = 1_h;
-const time::nanoseconds NETMON_DAMPEN_PERIOD = 5_s;
+constexpr time::nanoseconds DAEMON_INITIAL_DELAY = 100_ms;
+constexpr time::nanoseconds DAEMON_UNCONDITIONAL_INTERVAL = 1_h;
+constexpr time::nanoseconds NETMON_DAMPEN_PERIOD = 5_s;
static void
usage(std::ostream& os,
diff --git a/tools/ndn-autoconfig/multicast-discovery.cpp b/tools/ndn-autoconfig/multicast-discovery.cpp
index 0a76b22..a9fbc88 100644
--- a/tools/ndn-autoconfig/multicast-discovery.cpp
+++ b/tools/ndn-autoconfig/multicast-discovery.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,
@@ -36,9 +36,9 @@
using nfd::ControlParameters;
const Name HUB_DISCOVERY_PREFIX("/localhop/ndn-autoconf/hub");
-const uint64_t HUB_DISCOVERY_ROUTE_COST(1);
-const time::milliseconds HUB_DISCOVERY_ROUTE_EXPIRATION = 30_s;
-const time::milliseconds HUB_DISCOVERY_INTEREST_LIFETIME = 4_s;
+constexpr uint64_t HUB_DISCOVERY_ROUTE_COST(1);
+constexpr time::milliseconds HUB_DISCOVERY_ROUTE_EXPIRATION = 30_s;
+constexpr time::milliseconds HUB_DISCOVERY_INTEREST_LIFETIME = 4_s;
MulticastDiscovery::MulticastDiscovery(Face& face, nfd::Controller& controller)
: m_face(face)
diff --git a/tools/ndn-autoconfig/procedure.cpp b/tools/ndn-autoconfig/procedure.cpp
index b0896ec..cda39ad 100644
--- a/tools/ndn-autoconfig/procedure.cpp
+++ b/tools/ndn-autoconfig/procedure.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,
@@ -36,10 +36,10 @@
using nfd::ControlParameters;
using nfd::ControlResponse;
-const time::nanoseconds FACEURI_CANONIZE_TIMEOUT = 4_s;
+constexpr time::nanoseconds FACEURI_CANONIZE_TIMEOUT = 4_s;
const std::vector<Name> HUB_PREFIXES{"/", "/localhop/nfd"};
-const nfd::RouteOrigin HUB_ROUTE_ORIGIN = nfd::ROUTE_ORIGIN_AUTOCONF;
-const uint64_t HUB_ROUTE_COST = 100;
+constexpr nfd::RouteOrigin HUB_ROUTE_ORIGIN = nfd::ROUTE_ORIGIN_AUTOCONF;
+constexpr uint64_t HUB_ROUTE_COST = 100;
Procedure::Procedure(Face& face, KeyChain& keyChain)
: m_face(face)