Refactor and modernize namespace declarations

Move all unit tests to namespace nfd::tests

Delete unused header core/algorithm.hpp

Change-Id: I5591f0c5f3bb5db67f8b45fae95471f8a555ca68
diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index 470e850..e02caa1 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.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,
@@ -25,8 +25,7 @@
 
 #include "cs-entry.hpp"
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 
 Entry::Entry(shared_ptr<const Data> data, bool isUnsolicited)
   : m_data(std::move(data))
@@ -111,5 +110,4 @@
   return compareDataWithData(lhs.getData(), rhs.getData()) < 0;
 }
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index 5dd931d..a04f9f7 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.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,
@@ -28,8 +28,7 @@
 
 #include "core/common.hpp"
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 
 /** \brief a ContentStore entry
  */
@@ -121,7 +120,6 @@
   return *lhs < *rhs;
 }
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
 
 #endif // NFD_DAEMON_TABLE_CS_ENTRY_HPP
diff --git a/daemon/table/cs-policy-lru.cpp b/daemon/table/cs-policy-lru.cpp
index 1b477aa..80b5994 100644
--- a/daemon/table/cs-policy-lru.cpp
+++ b/daemon/table/cs-policy-lru.cpp
@@ -26,9 +26,7 @@
 #include "cs-policy-lru.hpp"
 #include "cs.hpp"
 
-namespace nfd {
-namespace cs {
-namespace lru {
+namespace nfd::cs::lru {
 
 const std::string LruPolicy::POLICY_NAME = "lru";
 NFD_REGISTER_CS_POLICY(LruPolicy);
@@ -87,6 +85,4 @@
   }
 }
 
-} // namespace lru
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs::lru
diff --git a/daemon/table/cs-policy-lru.hpp b/daemon/table/cs-policy-lru.hpp
index 5d61e47..8d7c814 100644
--- a/daemon/table/cs-policy-lru.hpp
+++ b/daemon/table/cs-policy-lru.hpp
@@ -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,
@@ -32,8 +32,7 @@
 #include <boost/multi_index/sequenced_index.hpp>
 #include <boost/multi_index/ordered_index.hpp>
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 namespace lru {
 
 using Queue = boost::multi_index_container<
@@ -84,7 +83,6 @@
 
 using lru::LruPolicy;
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
 
 #endif // NFD_DAEMON_TABLE_CS_POLICY_LRU_HPP
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index d037175..4405e66 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.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,
@@ -27,9 +27,7 @@
 #include "cs.hpp"
 #include "common/global.hpp"
 
-namespace nfd {
-namespace cs {
-namespace priority_fifo {
+namespace nfd::cs::priority_fifo {
 
 const std::string PriorityFifoPolicy::POLICY_NAME = "priority_fifo";
 NFD_REGISTER_CS_POLICY(PriorityFifoPolicy);
@@ -158,6 +156,4 @@
   m_entryInfoMap[i] = entryInfo;
 }
 
-} // namespace priority_fifo
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs::priority_fifo
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index 757b0c5..48d1d66 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -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,
@@ -30,8 +30,7 @@
 
 #include <list>
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 namespace priority_fifo {
 
 using Queue = std::list<Policy::EntryRef>;
@@ -121,7 +120,6 @@
 
 using priority_fifo::PriorityFifoPolicy;
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
 
 #endif // NFD_DAEMON_TABLE_CS_POLICY_PRIORITY_FIFO_HPP
diff --git a/daemon/table/cs-policy.cpp b/daemon/table/cs-policy.cpp
index 6b24eb3..3e3fc53 100644
--- a/daemon/table/cs-policy.cpp
+++ b/daemon/table/cs-policy.cpp
@@ -32,8 +32,7 @@
 
 NFD_LOG_INIT(CsPolicy);
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 
 Policy::Registry&
 Policy::getRegistry()
@@ -100,5 +99,4 @@
   this->doBeforeUse(i);
 }
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/cs-policy.hpp b/daemon/table/cs-policy.hpp
index 9a4c6ed..de4c89c 100644
--- a/daemon/table/cs-policy.hpp
+++ b/daemon/table/cs-policy.hpp
@@ -28,8 +28,7 @@
 
 #include "cs-entry.hpp"
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 
 class Cs;
 
@@ -206,8 +205,7 @@
   Cs* m_cs;
 };
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
 
 /** \brief registers a CS policy
  *  \param P a subclass of nfd::cs::Policy
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index 5fc8301..18d8fe2 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -25,13 +25,11 @@
 
 #include "cs.hpp"
 #include "common/logger.hpp"
-#include "core/algorithm.hpp"
 
 #include <ndn-cxx/lp/tags.hpp>
 #include <ndn-cxx/util/concepts.hpp>
 
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
 
 NFD_LOG_INIT(ContentStore);
 
@@ -178,5 +176,4 @@
   NFD_LOG_INFO((shouldServe ? "Enabling" : "Disabling") << " Data serving");
 }
 
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
index 71c2516..cb97ea2 100644
--- a/daemon/table/fib-entry.cpp
+++ b/daemon/table/fib-entry.cpp
@@ -25,8 +25,7 @@
 
 #include "fib-entry.hpp"
 
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
 
 Entry::Entry(const Name& prefix)
   : m_prefix(prefix)
@@ -83,5 +82,4 @@
             [] (const NextHop& a, const NextHop& b) { return a.getCost() < b.getCost(); });
 }
 
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
index facf248..13825b7 100644
--- a/daemon/table/fib-entry.hpp
+++ b/daemon/table/fib-entry.hpp
@@ -28,13 +28,11 @@
 
 #include "fib-nexthop.hpp"
 
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
 class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
 
-namespace fib {
+namespace nfd::fib {
 
 class Fib;
 
@@ -121,7 +119,6 @@
   friend Fib;
 };
 
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
 
 #endif // NFD_DAEMON_TABLE_FIB_ENTRY_HPP
diff --git a/daemon/table/fib-nexthop.hpp b/daemon/table/fib-nexthop.hpp
index e03efda..b696cea 100644
--- a/daemon/table/fib-nexthop.hpp
+++ b/daemon/table/fib-nexthop.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,
@@ -29,8 +29,7 @@
 #include "core/common.hpp"
 #include "face/face.hpp"
 
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
 
 /** \brief Represents a nexthop record in a FIB entry
  */
@@ -66,7 +65,6 @@
   uint64_t m_cost = 0;
 };
 
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
 
 #endif // NFD_DAEMON_TABLE_FIB_NEXTHOP_HPP
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
index c6c8f2c..f30b976 100644
--- a/daemon/table/fib.cpp
+++ b/daemon/table/fib.cpp
@@ -29,8 +29,7 @@
 
 #include <ndn-cxx/util/concepts.hpp>
 
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
 
 NDN_CXX_ASSERT_FORWARD_ITERATOR(Fib::const_iterator);
 
@@ -165,5 +164,4 @@
          boost::adaptors::transformed(name_tree::GetTableEntry<Entry>(&name_tree::Entry::getFibEntry));
 }
 
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
diff --git a/daemon/table/measurements-accessor.cpp b/daemon/table/measurements-accessor.cpp
index 68cf784..3206c2e 100644
--- a/daemon/table/measurements-accessor.cpp
+++ b/daemon/table/measurements-accessor.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  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,
@@ -25,14 +25,11 @@
 
 #include "measurements-accessor.hpp"
 
-namespace nfd {
-namespace measurements {
-
-using fw::Strategy;
+namespace nfd::measurements {
 
 MeasurementsAccessor::MeasurementsAccessor(Measurements& measurements,
                                            const StrategyChoice& strategyChoice,
-                                           const Strategy& strategy)
+                                           const fw::Strategy& strategy)
   : m_measurements(measurements)
   , m_strategyChoice(strategyChoice)
   , m_strategy(&strategy)
@@ -50,12 +47,11 @@
     return entry;
   }
 
-  Strategy& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
+  auto& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
   if (&effectiveStrategy == m_strategy) {
     return entry;
   }
   return nullptr;
 }
 
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
diff --git a/daemon/table/measurements-entry.hpp b/daemon/table/measurements-entry.hpp
index a70f6e0..56825b6 100644
--- a/daemon/table/measurements-entry.hpp
+++ b/daemon/table/measurements-entry.hpp
@@ -28,13 +28,11 @@
 
 #include "strategy-info-host.hpp"
 
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
 class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
 
-namespace measurements {
+namespace nfd::measurements {
 
 class Measurements;
 
@@ -68,7 +66,6 @@
   friend name_tree::Entry;
 };
 
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
 
 #endif // NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP
diff --git a/daemon/table/measurements.cpp b/daemon/table/measurements.cpp
index af3cc1e..7a5f9b7 100644
--- a/daemon/table/measurements.cpp
+++ b/daemon/table/measurements.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,
@@ -29,8 +29,7 @@
 #include "fib-entry.hpp"
 #include "common/global.hpp"
 
-namespace nfd {
-namespace measurements {
+namespace nfd::measurements {
 
 Measurements::Measurements(NameTree& nameTree)
   : m_nameTree(nameTree)
@@ -150,5 +149,4 @@
   --m_nItems;
 }
 
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
diff --git a/daemon/table/name-tree-entry.cpp b/daemon/table/name-tree-entry.cpp
index c145129..a4f898b 100644
--- a/daemon/table/name-tree-entry.cpp
+++ b/daemon/table/name-tree-entry.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,
@@ -26,8 +26,7 @@
 #include "name-tree-entry.hpp"
 #include "name-tree.hpp"
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 Entry::Entry(const Name& name, Node* node)
   : m_name(name)
@@ -139,5 +138,4 @@
   }
 }
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
index 9c101ff..644d86b 100644
--- a/daemon/table/name-tree-entry.hpp
+++ b/daemon/table/name-tree-entry.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,
@@ -31,8 +31,7 @@
 #include "table/measurements-entry.hpp"
 #include "table/strategy-choice-entry.hpp"
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 class Node;
 
@@ -207,7 +206,6 @@
   Getter m_getter;
 };
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
 
 #endif // NFD_DAEMON_TABLE_NAME_TREE_ENTRY_HPP
diff --git a/daemon/table/name-tree-hashtable.cpp b/daemon/table/name-tree-hashtable.cpp
index fc17523..390507d 100644
--- a/daemon/table/name-tree-hashtable.cpp
+++ b/daemon/table/name-tree-hashtable.cpp
@@ -27,8 +27,7 @@
 #include "common/city-hash.hpp"
 #include "common/logger.hpp"
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 NFD_LOG_INIT(NameTreeHashtable);
 
@@ -278,5 +277,4 @@
   this->computeThresholds();
 }
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-hashtable.hpp b/daemon/table/name-tree-hashtable.hpp
index 2880984..de96d0a 100644
--- a/daemon/table/name-tree-hashtable.hpp
+++ b/daemon/table/name-tree-hashtable.hpp
@@ -28,8 +28,7 @@
 
 #include "name-tree-entry.hpp"
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 class Entry;
 
@@ -246,7 +245,6 @@
   size_t m_shrinkThreshold;
 };
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
 
 #endif // NFD_DAEMON_TABLE_NAME_TREE_HASHTABLE_HPP
diff --git a/daemon/table/name-tree-iterator.cpp b/daemon/table/name-tree-iterator.cpp
index 33b5382..001bb06 100644
--- a/daemon/table/name-tree-iterator.cpp
+++ b/daemon/table/name-tree-iterator.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 <boost/range/concepts.hpp>
 #include <ndn-cxx/util/concepts.hpp>
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
 BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<Range>));
@@ -257,5 +256,4 @@
   i = Iterator();
 }
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index d99e5f9..fc04fb6 100644
--- a/daemon/table/name-tree-iterator.hpp
+++ b/daemon/table/name-tree-iterator.hpp
@@ -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,
@@ -28,8 +28,7 @@
 
 #include "name-tree-hashtable.hpp"
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 class NameTree;
 
@@ -211,7 +210,6 @@
  */
 using Range = boost::iterator_range<Iterator>;
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
 
 #endif // NFD_DAEMON_TABLE_NAME_TREE_ITERATOR_HPP
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
index aac885c..1758532 100644
--- a/daemon/table/name-tree.cpp
+++ b/daemon/table/name-tree.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 <boost/concept_check.hpp>
 #include <type_traits>
 
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
 
 NFD_LOG_INIT(NameTree);
 
@@ -236,5 +235,4 @@
   return {Iterator(make_shared<PartialEnumerationImpl>(*this, entrySubTreeSelector), entry), end()};
 }
 
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index e2e194f..b302c28 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.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,
@@ -27,8 +27,7 @@
 
 #include <algorithm>
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 Entry::Entry(const Interest& interest)
   : m_interest(interest.shared_from_this())
@@ -120,5 +119,4 @@
   }
 }
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index e088e70..6287e44 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -31,13 +31,11 @@
 
 #include <list>
 
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
 class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
 
-namespace pit {
+namespace nfd::pit {
 
 /**
  * \brief An unordered collection of in-records
@@ -246,7 +244,6 @@
   friend name_tree::Entry;
 };
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
 
 #endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
diff --git a/daemon/table/pit-face-record.cpp b/daemon/table/pit-face-record.cpp
index 4674b8e..c0f43bc 100644
--- a/daemon/table/pit-face-record.cpp
+++ b/daemon/table/pit-face-record.cpp
@@ -25,8 +25,7 @@
 
 #include "pit-face-record.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 // Impose a maximum lifetime to prevent integer overflow when calculating m_expiry.
 const time::milliseconds MAX_LIFETIME = 10_days;
@@ -42,5 +41,4 @@
   m_expiry = m_lastRenewed + lifetime;
 }
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index 1a68a51..edb0783 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  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,
@@ -29,8 +29,7 @@
 #include "face/face.hpp"
 #include "strategy-info-host.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 /** \brief Contains information about an Interest on an incoming or outgoing face
  *  \note This is an implementation detail to extract common functionality
@@ -84,7 +83,6 @@
   time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
 };
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
 
 #endif // NFD_DAEMON_TABLE_PIT_FACE_RECORD_HPP
diff --git a/daemon/table/pit-in-record.cpp b/daemon/table/pit-in-record.cpp
index 15131da..6982780 100644
--- a/daemon/table/pit-in-record.cpp
+++ b/daemon/table/pit-in-record.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,
@@ -25,8 +25,7 @@
 
 #include "pit-in-record.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 void
 InRecord::update(const Interest& interest)
@@ -35,5 +34,4 @@
   m_interest = interest.shared_from_this();
 }
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-in-record.hpp b/daemon/table/pit-in-record.hpp
index 002537b..c61f61d 100644
--- a/daemon/table/pit-in-record.hpp
+++ b/daemon/table/pit-in-record.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,
@@ -28,8 +28,7 @@
 
 #include "pit-face-record.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 /** \brief Contains information about an Interest from an incoming face
  */
@@ -52,7 +51,6 @@
   shared_ptr<const Interest> m_interest;
 };
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
 
 #endif // NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
diff --git a/daemon/table/pit-iterator.cpp b/daemon/table/pit-iterator.cpp
index 58777a7..f0d0c8a 100644
--- a/daemon/table/pit-iterator.cpp
+++ b/daemon/table/pit-iterator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  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,
@@ -27,8 +27,7 @@
 
 #include <ndn-cxx/util/concepts.hpp>
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
 
@@ -61,5 +60,4 @@
   return copy;
 }
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-iterator.hpp b/daemon/table/pit-iterator.hpp
index b788e3c..014ddc1 100644
--- a/daemon/table/pit-iterator.hpp
+++ b/daemon/table/pit-iterator.hpp
@@ -29,8 +29,7 @@
 #include "name-tree.hpp"
 #include "pit-entry.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 /** \brief PIT iterator
  */
@@ -87,7 +86,6 @@
   size_t m_iPitEntry; ///< current PIT entry within m_ntIt->getPitEntries()
 };
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
 
 #endif // NFD_DAEMON_TABLE_PIT_ITERATOR_HPP
diff --git a/daemon/table/pit-out-record.cpp b/daemon/table/pit-out-record.cpp
index e86f440..1f3e899 100644
--- a/daemon/table/pit-out-record.cpp
+++ b/daemon/table/pit-out-record.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,
@@ -25,8 +25,7 @@
 
 #include "pit-out-record.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 bool
 OutRecord::setIncomingNack(const lp::Nack& nack)
@@ -39,5 +38,4 @@
   return true;
 }
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-out-record.hpp b/daemon/table/pit-out-record.hpp
index 383e0c8..aeb7523 100644
--- a/daemon/table/pit-out-record.hpp
+++ b/daemon/table/pit-out-record.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,
@@ -28,8 +28,7 @@
 
 #include "pit-face-record.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 /** \brief Contains information about an Interest toward an outgoing face
  */
@@ -75,7 +74,6 @@
   unique_ptr<lp::NackHeader> m_incomingNack;
 };
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
 
 #endif // NFD_DAEMON_TABLE_PIT_OUT_RECORD_HPP
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index cc447f2..4ebdefb 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.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,
@@ -25,8 +25,7 @@
 
 #include "pit.hpp"
 
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
 
 static inline bool
 nteHasPitEntries(const name_tree::Entry& nte)
@@ -128,5 +127,4 @@
   return const_iterator(m_nameTree.fullEnumerate(&nteHasPitEntries).begin());
 }
 
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp
index 1a1ea8e..a752e45 100644
--- a/daemon/table/strategy-choice-entry.cpp
+++ b/daemon/table/strategy-choice-entry.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,
@@ -26,8 +26,7 @@
 #include "strategy-choice-entry.hpp"
 #include "fw/strategy.hpp"
 
-namespace nfd {
-namespace strategy_choice {
+namespace nfd::strategy_choice {
 
 Entry::Entry(const Name& prefix)
   : m_prefix(prefix)
@@ -48,5 +47,4 @@
   m_strategy = std::move(strategy);
 }
 
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
diff --git a/daemon/table/strategy-choice-entry.hpp b/daemon/table/strategy-choice-entry.hpp
index ac59234..a47337f 100644
--- a/daemon/table/strategy-choice-entry.hpp
+++ b/daemon/table/strategy-choice-entry.hpp
@@ -28,17 +28,15 @@
 
 #include "core/common.hpp"
 
-namespace nfd {
-
-namespace fw {
+namespace nfd::fw {
 class Strategy;
-} // namespace fw
+} // namespace nfd::fw
 
-namespace name_tree {
+namespace nfd::name_tree {
 class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
 
-namespace strategy_choice {
+namespace nfd::strategy_choice {
 
 /**
  * \brief Represents an entry in the %Strategy %Choice table.
@@ -85,7 +83,6 @@
   friend name_tree::Entry;
 };
 
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
 
 #endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index e03306c..cefb245 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.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,
@@ -32,8 +32,7 @@
 
 #include <ndn-cxx/util/concepts.hpp>
 
-namespace nfd {
-namespace strategy_choice {
+namespace nfd::strategy_choice {
 
 NDN_CXX_ASSERT_FORWARD_ITERATOR(StrategyChoice::const_iterator);
 
@@ -266,5 +265,4 @@
                                       &name_tree::Entry::getStrategyChoiceEntry));
 }
 
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice