build: switch to C++17

Change-Id: Ie68020a04b7e20b74778b6d0370544ded55c5e26
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 7b3859f..89031fd 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.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,
@@ -54,8 +54,8 @@
   void
   createFace(const std::string& uri = "tcp4://127.0.0.1:26363",
              ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-             optional<time::nanoseconds> baseCongestionMarkingInterval = nullopt,
-             optional<uint64_t> defaultCongestionThreshold = nullopt,
+             std::optional<time::nanoseconds> baseCongestionMarkingInterval = std::nullopt,
+             std::optional<uint64_t> defaultCongestionThreshold = std::nullopt,
              bool enableLocalFields = false,
              bool enableReliability = false,
              boost::logic::tribool enableCongestionMarking = boost::logic::indeterminate)
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 048f76d..6131670 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.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,
@@ -95,9 +95,9 @@
    */
   CheckNextHopResult
   checkNextHop(const Name& prefix,
-               optional<size_t> expectedNNextHops = nullopt,
-               optional<FaceId> faceId = nullopt,
-               optional<uint64_t> expectedCost = nullopt) const
+               std::optional<size_t> expectedNNextHops = std::nullopt,
+               std::optional<FaceId> faceId = std::nullopt,
+               std::optional<uint64_t> expectedCost = std::nullopt) const
   {
     const fib::Entry* entry = m_fib.findExactMatch(prefix);
     if (entry == nullptr) {
@@ -128,7 +128,7 @@
   FibManager m_manager;
 };
 
-std::ostream&
+static std::ostream&
 operator<<(std::ostream& os, FibManagerFixture::CheckNextHopResult result)
 {
   switch (result) {
@@ -163,7 +163,8 @@
                     CheckResponseResult::OK);
 
   // double check that the next hop was not added
-  BOOST_CHECK_EQUAL(checkNextHop("/hello", nullopt, nullopt, 101), CheckNextHopResult::NO_FIB_ENTRY);
+  BOOST_CHECK_EQUAL(checkNextHop("/hello", std::nullopt, std::nullopt, 101),
+                    CheckNextHopResult::NO_FIB_ENTRY);
 }
 
 BOOST_AUTO_TEST_CASE(NameTooLong)
@@ -388,12 +389,12 @@
   testRemoveNextHop(makeParameters("/hello", face2 + 100));
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1); // face does not exist
   BOOST_CHECK_EQUAL(checkResponse(0, expectedName, expectedResponse), CheckResponseResult::OK);
-  BOOST_CHECK_EQUAL(checkNextHop("/hello", nullopt, face2 + 100), CheckNextHopResult::NO_NEXTHOP);
+  BOOST_CHECK_EQUAL(checkNextHop("/hello", std::nullopt, face2 + 100), CheckNextHopResult::NO_NEXTHOP);
 
   testRemoveNextHop(makeParameters("/hello", face2));
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1); // record does not exist
   BOOST_CHECK_EQUAL(checkResponse(0, expectedName, expectedResponse), CheckResponseResult::OK);
-  BOOST_CHECK_EQUAL(checkNextHop("/hello", nullopt, face2), CheckNextHopResult::NO_NEXTHOP);
+  BOOST_CHECK_EQUAL(checkNextHop("/hello", std::nullopt, face2), CheckNextHopResult::NO_NEXTHOP);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // RemoveNextHop
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 597bad4..4d15659 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -91,7 +91,7 @@
   SlAnnounceResult
   slAnnounceSync(const ndn::PrefixAnnouncement& pa, uint64_t faceId, time::milliseconds maxLifetime)
   {
-    optional<SlAnnounceResult> result;
+    std::optional<SlAnnounceResult> result;
     manager->slAnnounce(pa, faceId, maxLifetime,
       [&] (RibManager::SlAnnounceResult res) {
         BOOST_CHECK(!result);
@@ -108,7 +108,7 @@
   SlAnnounceResult
   slRenewSync(const Name& name, uint64_t faceId, time::milliseconds maxLifetime)
   {
-    optional<SlAnnounceResult> result;
+    std::optional<SlAnnounceResult> result;
     manager->slRenew(name, faceId, maxLifetime,
       [&] (RibManager::SlAnnounceResult res) {
         BOOST_CHECK(!result);
@@ -122,19 +122,19 @@
 
   /** \brief Invoke manager->slFindAnn and wait for result.
    */
-  optional<ndn::PrefixAnnouncement>
+  std::optional<ndn::PrefixAnnouncement>
   slFindAnnSync(const Name& name)
   {
-    optional<optional<ndn::PrefixAnnouncement>> result;
+    std::optional<std::optional<ndn::PrefixAnnouncement>> result;
     manager->slFindAnn(name,
-      [&] (optional<ndn::PrefixAnnouncement> found) {
+      [&] (std::optional<ndn::PrefixAnnouncement> found) {
         BOOST_CHECK(!result);
         result = found;
       });
 
     g_io.poll();
     BOOST_CHECK(result);
-    return result.value_or(nullopt);
+    return result.value_or(std::nullopt);
   }
 
   /** \brief Lookup a route with PREFIXANN origin.
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index d23eb70..682eb30 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -448,7 +448,7 @@
     rib::Route route;
     route.faceId = ++faceId;
     route.cost = route.faceId * 10;
-    route.expires = nullopt;
+    route.expires = std::nullopt;
     return route;
   };