core: drop std::function and ndn::Exclude from common.hpp, add ndn::optional

Change-Id: Ie3983d8b6f9929430efd8ada8d942e3f95755cd4
diff --git a/core/common.hpp b/core/common.hpp
index cde5437..156d59d 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -59,7 +59,6 @@
 #include <ndn-cxx/data.hpp>
 #include <ndn-cxx/delegation.hpp>
 #include <ndn-cxx/delegation-list.hpp>
-#include <ndn-cxx/exclude.hpp>
 #include <ndn-cxx/interest.hpp>
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/encoding/block.hpp>
@@ -92,18 +91,18 @@
 using std::dynamic_pointer_cast;
 using std::const_pointer_cast;
 
-using std::function;
 using std::bind;
-using std::ref;
 using std::cref;
+using std::ref;
 
+using ndn::optional;
+using ndn::nullopt;
 using ndn::to_string;
 
 using ndn::Block;
 using ndn::Data;
 using ndn::Delegation;
 using ndn::DelegationList;
-using ndn::Exclude;
 using ndn::FaceUri;
 using ndn::Interest;
 using ndn::Name;
diff --git a/core/config-file.hpp b/core/config-file.hpp
index 363c66d..d51b1e9 100644
--- a/core/config-file.hpp
+++ b/core/config-file.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -34,24 +34,23 @@
 
 /** \brief a config file section
  */
-typedef boost::property_tree::ptree ConfigSection;
+using ConfigSection = boost::property_tree::ptree;
 
 /** \brief an optional config file section
  */
-typedef boost::optional<const ConfigSection&> OptionalConfigSection;
+using OptionalConfigSection = boost::optional<const ConfigSection&>;
 
 /** \brief callback to process a config file section
  */
-typedef function<void(const ConfigSection& section,
-                      bool isDryRun,
-                      const std::string& filename)> ConfigSectionHandler;
+using ConfigSectionHandler = std::function<void(const ConfigSection& section, bool isDryRun,
+                                                const std::string& filename)>;
 
 /** \brief callback to process a config file section without a \p ConfigSectionHandler
  */
-typedef function<void(const std::string& filename,
-                      const std::string& sectionName,
-                      const ConfigSection& section,
-                      bool isDryRun)> UnknownConfigSectionHandler;
+using UnknownConfigSectionHandler = std::function<void(const std::string& filename,
+                                                       const std::string& sectionName,
+                                                       const ConfigSection& section,
+                                                       bool isDryRun)>;
 
 /** \brief configuration file parsing utility
  */
diff --git a/core/manager-base.hpp b/core/manager-base.hpp
index 3d0a465..cddb7c1 100644
--- a/core/manager-base.hpp
+++ b/core/manager-base.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -72,10 +72,10 @@
 
 PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
   // difference from mgmt::ControlCommand: accepts nfd::ControlParameters
-  typedef function<void(const ControlCommand& command,
-                        const Name& prefix, const Interest& interest,
-                        const ControlParameters& parameters,
-                        const ndn::mgmt::CommandContinuation done)> ControlCommandHandler;
+  using ControlCommandHandler = std::function<void(const ControlCommand& command,
+                                                   const Name& prefix, const Interest& interest,
+                                                   const ControlParameters& parameters,
+                                                   const ndn::mgmt::CommandContinuation done)>;
 
   template<typename Command>
   void
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
index cdb7078..5b870fe 100644
--- a/daemon/face/channel.hpp
+++ b/daemon/face/channel.hpp
@@ -37,11 +37,11 @@
 /** \brief Prototype for the callback that is invoked when a face is created
  *         (in response to an incoming connection or after a connection is established)
  */
-using FaceCreatedCallback = function<void(const shared_ptr<Face>& face)>;
+using FaceCreatedCallback = std::function<void(const shared_ptr<Face>& face)>;
 
 /** \brief Prototype for the callback that is invoked when a face fails to be created
  */
-using FaceCreationFailedCallback = function<void(uint32_t status, const std::string& reason)>;
+using FaceCreationFailedCallback = std::function<void(uint32_t status, const std::string& reason)>;
 
 /** \brief represent a channel that communicates on a local endpoint
  *  \sa FaceSystem
@@ -98,8 +98,8 @@
 
 public:
   ndn::nfd::FacePersistency persistency;
-  ndn::optional<time::nanoseconds> baseCongestionMarkingInterval;
-  ndn::optional<uint64_t> defaultCongestionThreshold;
+  optional<time::nanoseconds> baseCongestionMarkingInterval;
+  optional<uint64_t> defaultCongestionThreshold;
   bool wantLocalFields;
   bool wantLpReliability;
   boost::logic::tribool wantCongestionMarking;
diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
index fe3f1f8..74dbde7 100644
--- a/daemon/face/protocol-factory.hpp
+++ b/daemon/face/protocol-factory.hpp
@@ -137,7 +137,7 @@
   struct CreateFaceRequest
   {
     FaceUri remoteUri;
-    ndn::optional<FaceUri> localUri;
+    optional<FaceUri> localUri;
     FaceParams params;
   };
 
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index c392b51..377d3b1 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -363,7 +363,7 @@
   return face;
 }
 
-static ndn::optional<ip::address>
+static optional<ip::address>
 pickAddress(const net::NetworkInterface& netif, net::AddressFamily af)
 {
   for (const auto& na : netif.getNetworkAddresses()) {
@@ -372,7 +372,7 @@
       return na.getIp();
     }
   }
-  return ndn::nullopt;
+  return nullopt;
 }
 
 std::vector<shared_ptr<Face>>
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index 36af43a..bcb3caf 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -259,7 +259,7 @@
    */
 #ifdef WITH_TESTS
   virtual void
-  dispatchToStrategy(pit::Entry& pitEntry, function<void(fw::Strategy&)> trigger)
+  dispatchToStrategy(pit::Entry& pitEntry, std::function<void(fw::Strategy&)> trigger)
 #else
   template<class Function>
   void
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index ae1b4bd..278e016 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -125,7 +125,7 @@
       return {input.getPrefix(i + 1), input[i].toVersion(), input.getSubName(i + 1)};
     }
   }
-  return {input, ndn::nullopt, PartialName()};
+  return {input, nullopt, PartialName()};
 }
 
 Name
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index b52c05b..0df65b9 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -336,7 +336,7 @@
   struct ParsedInstanceName
   {
     Name strategyName; ///< strategy name without parameters
-    ndn::optional<uint64_t> version; ///< whether strategyName contains a version component
+    optional<uint64_t> version; ///< whether strategyName contains a version component
     PartialName parameters; ///< parameter components
   };
 
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index 6f85fc7..04f2476 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -51,12 +51,12 @@
 
 /** \brief obtain signer from SignerTag attached to Interest, if available
  */
-static ndn::optional<std::string>
+static optional<std::string>
 getSignerFromTag(const Interest& interest)
 {
   shared_ptr<SignerTag> signerTag = interest.getTag<SignerTag>();
   if (signerTag == nullptr) {
-    return ndn::nullopt;
+    return nullopt;
   }
   else {
     return signerTag->get().toUri();
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 9d68256..76fac1c 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -88,7 +88,7 @@
     return;
   }
 
-  ndn::optional<FaceUri> localUri;
+  optional<FaceUri> localUri;
   if (parameters.hasLocalUri()) {
     localUri = FaceUri{};
 
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index 6251acd..87a93f7 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-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -35,31 +35,31 @@
 
 /** \brief a predicate to accept or reject an Entry in find operations
  */
-typedef function<bool(const Entry& entry)> EntrySelector;
+using EntrySelector = std::function<bool(const Entry&)>;
 
 /** \brief an EntrySelector that accepts every Entry
  */
 struct AnyEntry
 {
   bool
-  operator()(const Entry& entry) const
+  operator()(const Entry&) const
   {
     return true;
   }
 };
 
 /** \brief a predicate to accept or reject an Entry and its children
- *  \return .first indicates whether entry should be accepted;
- *          .second indicates whether entry's children should be visited
+ *  \return `.first` indicates whether entry should be accepted;
+ *          `.second` indicates whether entry's children should be visited
  */
-typedef function<std::pair<bool,bool>(const Entry& entry)> EntrySubTreeSelector;
+using EntrySubTreeSelector = std::function<std::pair<bool, bool>(const Entry&)>;
 
 /** \brief an EntrySubTreeSelector that accepts every Entry and its children
  */
 struct AnyEntrySubTree
 {
   std::pair<bool, bool>
-  operator()(const Entry& entry) const
+  operator()(const Entry&) const
   {
     return {true, true};
   }
@@ -203,7 +203,7 @@
  *  This type has .begin() and .end() methods which return Iterator.
  *  This type is usable with range-based for.
  */
-typedef boost::iterator_range<Iterator> Range;
+using Range = boost::iterator_range<Iterator>;
 
 } // namespace name_tree
 } // namespace nfd
diff --git a/rib/fib-updater.hpp b/rib/fib-updater.hpp
index d68210c..90a788e 100644
--- a/rib/fib-updater.hpp
+++ b/rib/fib-updater.hpp
@@ -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-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -54,8 +54,8 @@
 public:
   typedef std::list<FibUpdate> FibUpdateList;
 
-  typedef function<void(RibUpdateList inheritedRoutes)> FibUpdateSuccessCallback;
-  typedef function<void(uint32_t code, const std::string& error)> FibUpdateFailureCallback;
+  typedef std::function<void(RibUpdateList inheritedRoutes)> FibUpdateSuccessCallback;
+  typedef std::function<void(uint32_t code, const std::string& error)> FibUpdateFailureCallback;
 
   FibUpdater(Rib& rib, ndn::nfd::Controller& controller);
 
diff --git a/rib/readvertise/client-to-nlsr-readvertise-policy.cpp b/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
index aba5fdb..ca54132 100644
--- a/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
+++ b/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,21 +28,21 @@
 namespace nfd {
 namespace rib {
 
-ndn::optional<ReadvertiseAction>
+optional<ReadvertiseAction>
 ClientToNlsrReadvertisePolicy::handleNewRoute(const RibRouteRef& ribRoute) const
 {
   if (ribRoute.route->origin == ndn::nfd::ROUTE_ORIGIN_CLIENT) {
     return ReadvertiseAction{ribRoute.entry->getName(), ndn::security::SigningInfo()};
   }
   else {
-    return ndn::nullopt;
+    return nullopt;
   }
 }
 
 time::milliseconds
 ClientToNlsrReadvertisePolicy::getRefreshInterval() const
 {
-  return time::seconds(3600);
+  return 1_h;
 }
 
 } // namespace rib
diff --git a/rib/readvertise/client-to-nlsr-readvertise-policy.hpp b/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
index af1481a..fd87360 100644
--- a/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
+++ b/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -41,7 +41,7 @@
    *  If the route origin is "client" (typically from auto prefix propagation), readvertise it
    *  using the default signing identity.
    */
-  ndn::optional<ReadvertiseAction>
+  optional<ReadvertiseAction>
   handleNewRoute(const RibRouteRef& ribRoute) const override;
 
   time::milliseconds
diff --git a/rib/readvertise/readvertise-policy.hpp b/rib/readvertise/readvertise-policy.hpp
index dce10b1..0f63745 100644
--- a/rib/readvertise/readvertise-policy.hpp
+++ b/rib/readvertise/readvertise-policy.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -50,7 +50,7 @@
 
   /** \brief decide whether to readvertise a route, and what prefix to readvertise
    */
-  virtual ndn::optional<ReadvertiseAction>
+  virtual optional<ReadvertiseAction>
   handleNewRoute(const RibRouteRef& ribRoute) const = 0;
 
   /** \return how often readvertisements made by this policy should be refreshed.
diff --git a/rib/readvertise/readvertise.cpp b/rib/readvertise/readvertise.cpp
index c585bf5..344bc7e 100644
--- a/rib/readvertise/readvertise.cpp
+++ b/rib/readvertise/readvertise.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -64,7 +64,7 @@
 void
 Readvertise::afterAddRoute(const RibRouteRef& ribRoute)
 {
-  ndn::optional<ReadvertiseAction> action = m_policy->handleNewRoute(ribRoute);
+  optional<ReadvertiseAction> action = m_policy->handleNewRoute(ribRoute);
   if (!action) {
     NFD_LOG_DEBUG("add-route " << ribRoute.entry->getName() << '(' << ribRoute.route->faceId <<
                   ',' << ribRoute.route->origin << ") not-readvertising");
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index ba89719..c955a0d 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -231,7 +231,7 @@
     route.setExpirationEvent(eventId);
   }
   else {
-    route.expires = ndn::nullopt;
+    route.expires = nullopt;
   }
 
   NFD_LOG_INFO("Adding route " << parameters.getName() << " nexthop=" << route.faceId
@@ -412,7 +412,7 @@
   Route route;
   route.faceId = result.getFaceId();
   route.origin = ndn::nfd::ROUTE_ORIGIN_APP;
-  route.expires = ndn::nullopt;
+  route.expires = nullopt;
   route.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
 
   m_rib.insert(prefix, route);
diff --git a/rib/rib.hpp b/rib/rib.hpp
index 78ea766..14ce12d 100644
--- a/rib/rib.hpp
+++ b/rib/rib.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -112,8 +112,8 @@
   findDescendantsForNonInsertedName(const Name& prefix) const;
 
 public:
-  typedef function<void()> UpdateSuccessCallback;
-  typedef function<void(uint32_t code, const std::string& error)> UpdateFailureCallback;
+  using UpdateSuccessCallback = std::function<void()>;
+  using UpdateFailureCallback = std::function<void(uint32_t code, const std::string& error)>;
 
   /** \brief passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates.
    *
@@ -176,7 +176,7 @@
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   // Used by RibManager unit-tests to get sent batch to simulate successful FIB update
-  function<void(RibUpdateBatch)> m_onSendBatchFromQueue;
+  std::function<void(RibUpdateBatch)> m_onSendBatchFromQueue;
 
   void
   erase(const Name& prefix, const Route& route);
diff --git a/rib/route.hpp b/rib/route.hpp
index 2dfeabb..5ad4d79 100644
--- a/rib/route.hpp
+++ b/rib/route.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,10 @@
 #define NFD_RIB_ROUTE_HPP
 
 #include "core/scheduler.hpp"
+
 #include <ndn-cxx/encoding/nfd-constants.hpp>
 #include <ndn-cxx/mgmt/nfd/route-flags-traits.hpp>
+
 #include <type_traits>
 
 namespace nfd {
@@ -64,7 +66,7 @@
   ndn::nfd::RouteOrigin origin;
   uint64_t cost;
   std::underlying_type<ndn::nfd::RouteFlags>::type flags;
-  ndn::optional<time::steady_clock::TimePoint> expires;
+  optional<time::steady_clock::TimePoint> expires;
 
 private:
   scheduler::EventId m_expirationEvent;
diff --git a/tests/daemon/face/factory-test-common.hpp b/tests/daemon/face/factory-test-common.hpp
index 15b3621..7b7bdf6 100644
--- a/tests/daemon/face/factory-test-common.hpp
+++ b/tests/daemon/face/factory-test-common.hpp
@@ -37,8 +37,8 @@
 struct TestFaceParams : public FaceParams
 {
   TestFaceParams(ndn::nfd::FacePersistency persistency,
-                 ndn::optional<time::nanoseconds> baseCongestionMarkingInterval,
-                 ndn::optional<uint64_t> defaultCongestionThreshold,
+                 optional<time::nanoseconds> baseCongestionMarkingInterval,
+                 optional<uint64_t> defaultCongestionThreshold,
                  bool wantLocalFields,
                  bool wantLpReliability,
                  boost::logic::tribool wantCongestionMarking) noexcept
@@ -62,7 +62,7 @@
 inline void
 createFace(ProtocolFactory& factory,
            const FaceUri& remoteUri,
-           const ndn::optional<FaceUri>& localUri,
+           const optional<FaceUri>& localUri,
            const TestFaceParams& params,
            const CreateFaceExpectedResult& expected,
            const std::function<void(const Face&)>& extraChecks = nullptr)
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 3ebe7f1..2337e07 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -100,7 +100,7 @@
   scheduler::EventId retxFrom4Evt;
   size_t nSentLast = strategy.sendInterestHistory.size();
   time::steady_clock::TimePoint timeSentLast = time::steady_clock::now();
-  function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
+  std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
   periodicalRetxFrom4 = [&] {
     pitEntry->insertOrUpdateInRecord(*face4, *interest);
     strategy.afterReceiveInterest(*face4, *interest, pitEntry);
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index a5118d8..82a93ea 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -190,7 +190,7 @@
 
 protected:
   void
-  dispatchToStrategy(pit::Entry& pitEntry, function<void(fw::Strategy&)> trigger) override
+  dispatchToStrategy(pit::Entry&, std::function<void(fw::Strategy&)>) override
   {
     ++dispatchToStrategy_count;
   }
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index 07e854c..d57f801 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -99,7 +99,7 @@
   scheduler::EventId retxFrom4Evt;
   size_t nSentLast = strategy.sendInterestHistory.size();
   time::steady_clock::TimePoint timeSentLast = time::steady_clock::now();
-  function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
+  std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
   periodicalRetxFrom4 = [&] {
     pitEntry->insertOrUpdateInRecord(*face3, *interest);
     strategy.afterReceiveInterest(*face3, *interest, pitEntry);
diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index ce4ab53..5f55451 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -60,7 +60,7 @@
 
   bool
   authorize(const std::string& module, const Name& identity,
-            const function<void(Interest&)>& modifyInterest = nullptr)
+            const std::function<void(Interest&)>& modifyInterest = nullptr)
   {
     Interest interest = this->makeControlCommandRequest(Name("/prefix/" + module + "/verb"),
                                                         ControlParameters(), identity);
@@ -262,7 +262,7 @@
   }
 
   bool
-  authorize1(const function<void(Interest&)>& modifyInterest)
+  authorize1(const std::function<void(Interest&)>& modifyInterest)
   {
     return authorize("module1", id1, modifyInterest);
   }
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 904b550..15bf6dd 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.cpp
@@ -53,8 +53,8 @@
   void
   createFace(const std::string& uri = "tcp4://127.0.0.1:26363",
              ndn::nfd::FacePersistency persistency = ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
-             ndn::optional<time::nanoseconds> baseCongestionMarkingInterval = {},
-             ndn::optional<uint64_t> defaultCongestionThreshold = {},
+             optional<time::nanoseconds> baseCongestionMarkingInterval = {},
+             optional<uint64_t> defaultCongestionThreshold = {},
              bool enableLocalFields = false,
              bool enableReliability = false,
              boost::logic::tribool enableCongestionMarking = boost::logic::indeterminate)
@@ -127,7 +127,7 @@
   void
   updateFace(const ControlParameters& requestParams,
              bool isSelfUpdating,
-             const function<void(const ControlResponse& resp)>& checkResp)
+             const std::function<void(const ControlResponse& resp)>& checkResp)
   {
     Interest req = makeControlCommandRequest("/localhost/nfd/faces/update", requestParams);
     if (isSelfUpdating) {
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 428b15b..e2986bc 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -35,8 +35,6 @@
 namespace nfd {
 namespace tests {
 
-using ndn::nullopt;
-
 class FibManagerFixture : public NfdManagerCommonFixture
 {
 public:
@@ -98,9 +96,9 @@
    */
   CheckNextHopResult
   checkNextHop(const Name& prefix,
-               ndn::optional<size_t> expectedNNextHops = nullopt,
-               ndn::optional<FaceId> faceId = nullopt,
-               ndn::optional<uint64_t> expectedCost = nullopt) const
+               optional<size_t> expectedNNextHops = nullopt,
+               optional<FaceId> faceId = nullopt,
+               optional<uint64_t> expectedCost = nullopt) const
   {
     const fib::Entry* entry = m_fib.findExactMatch(prefix);
     if (entry == nullptr) {
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index 66b7e95..a8363de 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.t.cpp
@@ -28,6 +28,8 @@
 #include "tests/test-common.hpp"
 
 #include <cstring>
+
+#include <ndn-cxx/exclude.hpp>
 #include <ndn-cxx/lp/tags.hpp>
 #include <ndn-cxx/util/sha256.hpp>
 
@@ -92,7 +94,7 @@
   size_t
   erase(const Name& prefix, size_t limit)
   {
-    ndn::optional<size_t> nErased;
+    optional<size_t> nErased;
     m_cs.erase(prefix, limit, [&] (size_t nErased1) { nErased = nErased1; });
 
     // current Cs::erase implementation is synchronous
@@ -331,7 +333,7 @@
   uint8_t digestFF[ndn::util::Sha256::DIGEST_SIZE];
   std::fill_n(digestFF, sizeof(digestFF), 0xFF);
 
-  Exclude excludeDigest;
+  ndn::Exclude excludeDigest;
   excludeDigest.excludeRange(
     name::Component::fromImplicitSha256Digest(digest00, sizeof(digest00)),
     name::Component::fromImplicitSha256Digest(digestFF, sizeof(digestFF)));
@@ -346,7 +348,7 @@
     .setExclude(excludeDigest);
   CHECK_CS_FIND(3);
 
-  Exclude excludeGeneric;
+  ndn::Exclude excludeGeneric;
   excludeGeneric.excludeAfter(name::Component(static_cast<uint8_t*>(nullptr), 0));
 
   startInterest("/A")
@@ -359,7 +361,7 @@
     .setExclude(excludeGeneric);
   find([] (uint32_t found) { BOOST_CHECK(found == 1 || found == 2); });
 
-  Exclude exclude2 = excludeGeneric;
+  ndn::Exclude exclude2 = excludeGeneric;
   exclude2.excludeOne(n2.get(-1));
 
   startInterest("/A")
diff --git a/tests/daemon/table/pit.t.cpp b/tests/daemon/table/pit.t.cpp
index c883ff4..511f2aa 100644
--- a/tests/daemon/table/pit.t.cpp
+++ b/tests/daemon/table/pit.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -24,10 +24,12 @@
  */
 
 #include "table/pit.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
 
+#include "tests/daemon/face/dummy-face.hpp"
 #include "tests/test-common.hpp"
 
+#include <ndn-cxx/exclude.hpp>
+
 namespace nfd {
 namespace pit {
 namespace tests {
@@ -60,9 +62,9 @@
 {
   Name name1("ndn:/5vzBNnMst");
   Name name2("ndn:/igSGfEIM62");
-  Exclude exclude1;
+  ndn::Exclude exclude1;
   exclude1.excludeOne(Name::Component("u26p47oep"));
-  Exclude exclude2;
+  ndn::Exclude exclude2;
   exclude2.excludeBefore(Name::Component("u26p47oep"));
   ndn::KeyLocator keyLocator1("ndn:/sGAE3peMHA");
   ndn::KeyLocator keyLocator2("ndn:/nIJH6pr4");
diff --git a/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp b/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
index 6535a87..6925de1 100644
--- a/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
+++ b/tests/rib/readvertise/client-to-nlsr-readvertise-policy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -46,7 +46,7 @@
   RibRouteRef rrr{entry, routeIt};
 
   ClientToNlsrReadvertisePolicy policy;
-  ndn::optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
+  optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
 
   BOOST_REQUIRE(action);
   BOOST_CHECK_EQUAL(action->prefix, "/test/A");
@@ -63,7 +63,7 @@
   RibRouteRef rrr{entry, routeIt};
 
   ClientToNlsrReadvertisePolicy policy;
-  ndn::optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
+  optional<ReadvertiseAction> action = policy.handleNewRoute(rrr);
 
   BOOST_CHECK(!action);
 }
diff --git a/tests/rib/readvertise/readvertise.t.cpp b/tests/rib/readvertise/readvertise.t.cpp
index 14949b8..5de7208 100644
--- a/tests/rib/readvertise/readvertise.t.cpp
+++ b/tests/rib/readvertise/readvertise.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,8 @@
 
 #include "rib/readvertise/readvertise.hpp"
 
-#include "tests/test-common.hpp"
 #include "tests/identity-management-fixture.hpp"
+
 #include <ndn-cxx/mgmt/nfd/controller.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 #include <boost/range/adaptor/transformed.hpp>
@@ -41,7 +41,7 @@
 class DummyReadvertisePolicy : public ReadvertisePolicy
 {
 public:
-  ndn::optional<ReadvertiseAction>
+  optional<ReadvertiseAction>
   handleNewRoute(const RibRouteRef& route) const override
   {
     return this->decision;
@@ -54,7 +54,7 @@
   }
 
 public:
-  ndn::optional<ReadvertiseAction> decision;
+  optional<ReadvertiseAction> decision;
 };
 
 class DummyReadvertiseDestination : public ReadvertiseDestination
@@ -195,7 +195,7 @@
 
 BOOST_AUTO_TEST_CASE(NoAdvertise)
 {
-  policy->decision = ndn::nullopt;
+  policy->decision = nullopt;
 
   this->insertRoute("/A/1", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
   this->insertRoute("/A/2", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 55ae1c8..cdf1581 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -452,7 +452,7 @@
     Route route;
     route.faceId = ++faceId;
     route.cost = route.faceId * 10;
-    route.expires = ndn::nullopt;
+    route.expires = nullopt;
     return route;
   };
 
diff --git a/tests/rib/rib.t.cpp b/tests/rib/rib.t.cpp
index e572a72..420a82d 100644
--- a/tests/rib/rib.t.cpp
+++ b/tests/rib/rib.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -291,17 +291,17 @@
 
   Route root = createRoute(1, 20);
   Name name1("/");
-  root.expires = ndn::nullopt;
+  root.expires = nullopt;
   rib.insert(name1, root);
 
   Route route1 = createRoute(2, 20);
   Name name2("/hello");
-  route1.expires = ndn::nullopt;
+  route1.expires = nullopt;
   rib.insert(name2, route1);
 
   Route route2 = createRoute(3, 20);
   Name name3("/hello/world");
-  route2.expires = ndn::nullopt;
+  route2.expires = nullopt;
   rib.insert(name3, route2);
 
   const std::string ribStr = std::string(R"TEXT(
diff --git a/tests/rib/route.t.cpp b/tests/rib/route.t.cpp
index d7b70eb..4d66d0d 100644
--- a/tests/rib/route.t.cpp
+++ b/tests/rib/route.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -24,6 +24,7 @@
  */
 
 #include "rib/route.hpp"
+
 #include "tests/test-common.hpp"
 
 namespace nfd {
@@ -63,9 +64,9 @@
   BOOST_CHECK_NE(a, b);
   a.cost = 103;
 
-  b.expires = ndn::nullopt;
+  b.expires = nullopt;
   BOOST_CHECK_NE(a, b);
-  a.expires = ndn::nullopt;
+  a.expires = nullopt;
 
   BOOST_CHECK_EQUAL(a, b);
 }
@@ -84,7 +85,7 @@
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(r),
                     "Route(faceid: 4980, origin: static, cost: 2312, flags: 0x1, expires in: 791214234 milliseconds)");
 
-  r.expires = ndn::nullopt;
+  r.expires = nullopt;
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(r),
                     "Route(faceid: 4980, origin: static, cost: 2312, flags: 0x1, never expires)");
 }
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index d0498e5..eb102eb 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -64,11 +64,11 @@
    *  \retval nullopt last Interest is not the expected command
    *  \return command parameters
    */
-  static ndn::optional<ControlParameters>
+  static optional<ControlParameters>
   parseCommand(const Interest& interest, const Name& expectedPrefix)
   {
     if (!expectedPrefix.isPrefixOf(interest.getName())) {
-      return ndn::nullopt;
+      return nullopt;
     }
     return ControlParameters(interest.getName().at(expectedPrefix.size()).blockFromValue());
   }
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index fbe212c..5cd25f9 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -69,11 +69,11 @@
     m_delay = delay;
   }
 
-  virtual void
+  void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
-              const CommandOptions& options) override
+              const CommandOptions& options) final
   {
     ++nFetchStatusCalls;
     scheduler::schedule(m_delay, [=] {
@@ -86,14 +86,14 @@
     });
   }
 
-  virtual void
-  formatStatusXml(std::ostream& os) const override
+  void
+  formatStatusXml(std::ostream& os) const final
   {
     os << '<' << m_moduleName << "/>";
   }
 
-  virtual void
-  formatStatusText(std::ostream& os) const override
+  void
+  formatStatusText(std::ostream& os) const final
   {
     os << m_moduleName << '\n';
   }
@@ -110,7 +110,7 @@
 class StatusReportTester : public StatusReport
 {
 private:
-  virtual void
+  void
   processEvents(Face&) override
   {
     processEventsFunc();
diff --git a/tools/nfdc/channel-module.cpp b/tools/nfdc/channel-module.cpp
index 15cffb4..81f69d4 100644
--- a/tools/nfdc/channel-module.cpp
+++ b/tools/nfdc/channel-module.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-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,7 +32,7 @@
 
 void
 ChannelModule::fetchStatus(Controller& controller,
-                           const function<void()>& onSuccess,
+                           const std::function<void()>& onSuccess,
                            const Controller::DatasetFailCallback& onFailure,
                            const CommandOptions& options)
 {
diff --git a/tools/nfdc/channel-module.hpp b/tools/nfdc/channel-module.hpp
index 6225a27..17989a6 100644
--- a/tools/nfdc/channel-module.hpp
+++ b/tools/nfdc/channel-module.hpp
@@ -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-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -40,13 +40,13 @@
 class ChannelModule : public Module, noncopyable
 {
 public:
-  virtual void
+  void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;
 
-  virtual void
+  void
   formatStatusXml(std::ostream& os) const override;
 
   /** \brief format a single status item as XML
@@ -56,7 +56,7 @@
   void
   formatItemXml(std::ostream& os, const ChannelStatus& item) const;
 
-  virtual void
+  void
   formatStatusText(std::ostream& os) const override;
 
   /** \brief format a single status item as text
diff --git a/tools/nfdc/command-arguments.hpp b/tools/nfdc/command-arguments.hpp
index 13aef61..a949f99 100644
--- a/tools/nfdc/command-arguments.hpp
+++ b/tools/nfdc/command-arguments.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -59,12 +59,12 @@
   /** \return the argument value, or nullopt if the argument is omitted on command line
    */
   template<typename T>
-  ndn::optional<T>
+  optional<T>
   getOptional(const std::string& key) const
   {
     auto i = find(key);
     if (i == end()) {
-      return ndn::nullopt;
+      return nullopt;
     }
     return boost::any_cast<T>(i->second);
   }
diff --git a/tools/nfdc/cs-module.cpp b/tools/nfdc/cs-module.cpp
index d42b82e..6a3b0b5 100644
--- a/tools/nfdc/cs-module.cpp
+++ b/tools/nfdc/cs-module.cpp
@@ -81,7 +81,7 @@
 
 void
 CsModule::fetchStatus(Controller& controller,
-                      const function<void()>& onSuccess,
+                      const std::function<void()>& onSuccess,
                       const Controller::DatasetFailCallback& onFailure,
                       const CommandOptions& options)
 {
diff --git a/tools/nfdc/cs-module.hpp b/tools/nfdc/cs-module.hpp
index 320ce09..4181290 100644
--- a/tools/nfdc/cs-module.hpp
+++ b/tools/nfdc/cs-module.hpp
@@ -53,7 +53,7 @@
 
   void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;
 
diff --git a/tools/nfdc/face-module.cpp b/tools/nfdc/face-module.cpp
index 888a7b3..23a03db 100644
--- a/tools/nfdc/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -161,7 +161,7 @@
   auto defaultCongestionThreshold = ctx.args.getOptional<uint64_t>("default-congestion-threshold");
 
   FaceUri canonicalRemote;
-  ndn::optional<FaceUri> canonicalLocal;
+  optional<FaceUri> canonicalLocal;
 
   auto handleCanonizeError = [&] (const FaceUri& faceUri, const std::string& error) {
     ctx.exitCode = 4;
@@ -346,7 +346,7 @@
 
 void
 FaceModule::fetchStatus(Controller& controller,
-                        const function<void()>& onSuccess,
+                        const std::function<void()>& onSuccess,
                         const Controller::DatasetFailCallback& onFailure,
                         const CommandOptions& options)
 {
diff --git a/tools/nfdc/face-module.hpp b/tools/nfdc/face-module.hpp
index 9f0ac2a..8083e74 100644
--- a/tools/nfdc/face-module.hpp
+++ b/tools/nfdc/face-module.hpp
@@ -69,7 +69,7 @@
 
   void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;
 
diff --git a/tools/nfdc/fib-module.cpp b/tools/nfdc/fib-module.cpp
index 3da24ee..ef2841e 100644
--- a/tools/nfdc/fib-module.cpp
+++ b/tools/nfdc/fib-module.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-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,7 +32,7 @@
 
 void
 FibModule::fetchStatus(Controller& controller,
-                       const function<void()>& onSuccess,
+                       const std::function<void()>& onSuccess,
                        const Controller::DatasetFailCallback& onFailure,
                        const CommandOptions& options)
 {
diff --git a/tools/nfdc/fib-module.hpp b/tools/nfdc/fib-module.hpp
index 6c33d64..a41c978 100644
--- a/tools/nfdc/fib-module.hpp
+++ b/tools/nfdc/fib-module.hpp
@@ -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-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -41,13 +41,13 @@
 class FibModule : public Module, noncopyable
 {
 public:
-  virtual void
+  void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;
 
-  virtual void
+  void
   formatStatusXml(std::ostream& os) const override;
 
   /** \brief format a single status item as XML
@@ -57,7 +57,7 @@
   void
   formatItemXml(std::ostream& os, const FibEntry& item) const;
 
-  virtual void
+  void
   formatStatusText(std::ostream& os) const override;
 
   /** \brief format a single status item as text
diff --git a/tools/nfdc/find-face.cpp b/tools/nfdc/find-face.cpp
index 89d8b03..918693f 100644
--- a/tools/nfdc/find-face.cpp
+++ b/tools/nfdc/find-face.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -25,6 +25,7 @@
 
 #include "find-face.hpp"
 #include "format-helpers.hpp"
+
 #include <ndn-cxx/util/logger.hpp>
 
 namespace nfd {
@@ -105,7 +106,7 @@
   return m_res;
 }
 
-ndn::optional<FaceUri>
+optional<FaceUri>
 FindFace::canonize(const std::string& fieldName, const FaceUri& input)
 {
   if (!FaceUri::canCanonize(input.getScheme())) {
@@ -113,7 +114,7 @@
     return input;
   }
 
-  ndn::optional<FaceUri> result;
+  optional<FaceUri> result;
   input.canonize(
     [&result] (const FaceUri& canonicalUri) { result = canonicalUri; },
     [this, fieldName] (const std::string& errorReason) {
diff --git a/tools/nfdc/find-face.hpp b/tools/nfdc/find-face.hpp
index 120718b..68e5f7b 100644
--- a/tools/nfdc/find-face.hpp
+++ b/tools/nfdc/find-face.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -125,7 +125,7 @@
    *  \return canonical FaceUri if canonization succeeds, input if canonization is unsupported
    *  \retval nullopt canonization fails; m_errorReason describes the failure
    */
-  ndn::optional<FaceUri>
+  optional<FaceUri>
   canonize(const std::string& fieldName, const FaceUri& input);
 
   /** \brief retrieve FaceStatus from filter
diff --git a/tools/nfdc/forwarder-general-module.cpp b/tools/nfdc/forwarder-general-module.cpp
index 67093ec..e0d6b1b 100644
--- a/tools/nfdc/forwarder-general-module.cpp
+++ b/tools/nfdc/forwarder-general-module.cpp
@@ -34,7 +34,7 @@
 
 void
 ForwarderGeneralModule::fetchStatus(Controller& controller,
-                                    const function<void()>& onSuccess,
+                                    const std::function<void()>& onSuccess,
                                     const Controller::DatasetFailCallback& onFailure,
                                     const CommandOptions& options)
 {
diff --git a/tools/nfdc/forwarder-general-module.hpp b/tools/nfdc/forwarder-general-module.hpp
index 4619cfa..10d5cf3 100644
--- a/tools/nfdc/forwarder-general-module.hpp
+++ b/tools/nfdc/forwarder-general-module.hpp
@@ -42,7 +42,7 @@
 public:
   void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;
 
diff --git a/tools/nfdc/module.hpp b/tools/nfdc/module.hpp
index 765e39b..b8ede30 100644
--- a/tools/nfdc/module.hpp
+++ b/tools/nfdc/module.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -55,7 +55,7 @@
    */
   virtual void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) = 0;
 
diff --git a/tools/nfdc/rib-module.cpp b/tools/nfdc/rib-module.cpp
index a5a2454..47acd0c 100644
--- a/tools/nfdc/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -258,7 +258,7 @@
 
 void
 RibModule::fetchStatus(Controller& controller,
-                       const function<void()>& onSuccess,
+                       const std::function<void()>& onSuccess,
                        const Controller::DatasetFailCallback& onFailure,
                        const CommandOptions& options)
 {
diff --git a/tools/nfdc/rib-module.hpp b/tools/nfdc/rib-module.hpp
index ae53928..6c64cd2 100644
--- a/tools/nfdc/rib-module.hpp
+++ b/tools/nfdc/rib-module.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -69,7 +69,7 @@
 
   void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;
 
@@ -80,7 +80,7 @@
   formatStatusText(std::ostream& os) const override;
 
 private:
-  using RoutePredicate = function<bool(const RibEntry&, const Route&)>;
+  using RoutePredicate = std::function<bool(const RibEntry&, const Route&)>;
 
   static void
   listRoutesImpl(ExecuteContext& ctx, const RoutePredicate& filter);
diff --git a/tools/nfdc/strategy-choice-module.cpp b/tools/nfdc/strategy-choice-module.cpp
index 5f81f7a..004f368 100644
--- a/tools/nfdc/strategy-choice-module.cpp
+++ b/tools/nfdc/strategy-choice-module.cpp
@@ -151,7 +151,7 @@
 
 void
 StrategyChoiceModule::fetchStatus(Controller& controller,
-                                  const function<void()>& onSuccess,
+                                  const std::function<void()>& onSuccess,
                                   const Controller::DatasetFailCallback& onFailure,
                                   const CommandOptions& options)
 {
diff --git a/tools/nfdc/strategy-choice-module.hpp b/tools/nfdc/strategy-choice-module.hpp
index 71fa9a2..7c403a9 100644
--- a/tools/nfdc/strategy-choice-module.hpp
+++ b/tools/nfdc/strategy-choice-module.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -68,7 +68,7 @@
 
   void
   fetchStatus(Controller& controller,
-              const function<void()>& onSuccess,
+              const std::function<void()>& onSuccess,
               const Controller::DatasetFailCallback& onFailure,
               const CommandOptions& options) override;