diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index 5601057..79cb436 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.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-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -94,7 +94,9 @@
 void
 FaceSystem::setConfigFile(ConfigFile& configFile)
 {
-  configFile.addSectionHandler(CFGSEC_FACESYSTEM, bind(&FaceSystem::processConfig, this, _1, _2, _3));
+  configFile.addSectionHandler(CFGSEC_FACESYSTEM, [this] (auto&&... args) {
+    processConfig(std::forward<decltype(args)>(args)...);
+  });
 }
 
 void
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index 819a91a..5ed4ac2 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -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-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,11 +45,11 @@
   , m_reassembler(m_options.reassemblerOptions, this)
   , m_reliability(m_options.reliabilityOptions, this)
   , m_lastSeqNo(-2)
-  , m_nextMarkTime(time::steady_clock::TimePoint::max())
+  , m_nextMarkTime(time::steady_clock::time_point::max())
   , m_nMarkedSinceInMarkingState(0)
 {
-  m_reassembler.beforeTimeout.connect([this] (auto...) { ++this->nReassemblyTimeouts; });
-  m_reliability.onDroppedInterest.connect([this] (const auto& i) { this->notifyDroppedInterest(i); });
+  m_reassembler.beforeTimeout.connect([this] (auto&&...) { ++nReassemblyTimeouts; });
+  m_reliability.onDroppedInterest.connect([this] (const auto& i) { notifyDroppedInterest(i); });
   nReassembling.observe(&m_reassembler);
 }
 
@@ -105,7 +105,7 @@
 
   auto block = pkt.wireEncode();
   if (mtu != MTU_UNLIMITED && block.size() > static_cast<size_t>(mtu)) {
-    ++this->nOutOverMtu;
+    ++nOutOverMtu;
     NFD_LOG_FACE_WARN("attempted to send packet over MTU limit");
     return;
   }
@@ -207,7 +207,7 @@
     std::tie(isOk, frags) = m_fragmenter.fragmentPacket(pkt, mtu);
     if (!isOk) {
       // fragmentation failed (warning is logged by LpFragmenter)
-      ++this->nFragmentationErrors;
+      ++nFragmentationErrors;
       return;
     }
   }
@@ -261,7 +261,7 @@
   if (static_cast<size_t>(sendQueueLength) > m_options.defaultCongestionThreshold) {
     const auto now = time::steady_clock::now();
 
-    if (m_nextMarkTime == time::steady_clock::TimePoint::max()) {
+    if (m_nextMarkTime == time::steady_clock::time_point::max()) {
       m_nextMarkTime = now + m_options.baseCongestionMarkingInterval;
     }
     // Mark packet if sendQueue stays above target for one interval
@@ -279,10 +279,10 @@
       m_nextMarkTime += interval;
     }
   }
-  else if (m_nextMarkTime != time::steady_clock::TimePoint::max()) {
+  else if (m_nextMarkTime != time::steady_clock::time_point::max()) {
     // Congestion incident has ended, so reset
     NFD_LOG_FACE_DEBUG("Send queue length dropped below congestion threshold");
-    m_nextMarkTime = time::steady_clock::TimePoint::max();
+    m_nextMarkTime = time::steady_clock::time_point::max();
     m_nMarkedSinceInMarkingState = 0;
   }
 }
@@ -296,7 +296,7 @@
     if (m_options.reliabilityOptions.isEnabled) {
       if (!m_reliability.processIncomingPacket(pkt)) {
         NFD_LOG_FACE_TRACE("received duplicate fragment: DROP");
-        ++this->nDuplicateSequence;
+        ++nDuplicateSequence;
         return;
       }
     }
@@ -321,7 +321,7 @@
     }
   }
   catch (const tlv::Error& e) {
-    ++this->nInLpInvalid;
+    ++nInLpInvalid;
     NFD_LOG_FACE_WARN("packet parse error (" << e.what() << "): DROP");
   }
 }
@@ -344,13 +344,13 @@
         this->decodeData(netPkt, firstPkt, endpointId);
         break;
       default:
-        ++this->nInNetInvalid;
+        ++nInNetInvalid;
         NFD_LOG_FACE_WARN("unrecognized network-layer packet TLV-TYPE " << netPkt.type() << ": DROP");
         return;
     }
   }
   catch (const tlv::Error& e) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("packet parse error (" << e.what() << "): DROP");
   }
 }
@@ -376,7 +376,7 @@
   }
 
   if (firstPkt.has<lp::CachePolicyField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received CachePolicy with Interest: DROP");
     return;
   }
@@ -399,7 +399,7 @@
   }
 
   if (firstPkt.has<lp::PrefixAnnouncementField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received PrefixAnnouncement with Interest: DROP");
     return;
   }
@@ -421,13 +421,13 @@
   auto data = make_shared<Data>(netPkt);
 
   if (firstPkt.has<lp::NackField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received Nack with Data: DROP");
     return;
   }
 
   if (firstPkt.has<lp::NextHopFaceIdField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NextHopFaceId with Data: DROP");
     return;
   }
@@ -448,7 +448,7 @@
   }
 
   if (firstPkt.has<lp::NonDiscoveryField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NonDiscovery with Data: DROP");
     return;
   }
@@ -476,13 +476,13 @@
   nack.setHeader(firstPkt.get<lp::NackField>());
 
   if (firstPkt.has<lp::NextHopFaceIdField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NextHopFaceId with Nack: DROP");
     return;
   }
 
   if (firstPkt.has<lp::CachePolicyField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received CachePolicy with Nack: DROP");
     return;
   }
@@ -496,13 +496,13 @@
   }
 
   if (firstPkt.has<lp::NonDiscoveryField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received NonDiscovery with Nack: DROP");
     return;
   }
 
   if (firstPkt.has<lp::PrefixAnnouncementField>()) {
-    ++this->nInNetInvalid;
+    ++nInNetInvalid;
     NFD_LOG_FACE_WARN("received PrefixAnnouncement with Nack: DROP");
     return;
   }
diff --git a/daemon/face/network-predicate.cpp b/daemon/face/network-predicate.cpp
index 31a2cf8..07de63c 100644
--- a/daemon/face/network-predicate.cpp
+++ b/daemon/face/network-predicate.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-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -198,8 +198,10 @@
 bool
 NetworkInterfacePredicate::operator()(const ndn::net::NetworkInterface& netif) const
 {
-  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesNetifMatchRule, std::cref(netif), _1)) &&
-         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesNetifMatchRule, std::cref(netif), _1));
+  return std::any_of(m_whitelist.begin(), m_whitelist.end(),
+                     [&netif] (const auto& rule) { return doesNetifMatchRule(netif, rule); }) &&
+         std::none_of(m_blacklist.begin(), m_blacklist.end(),
+                      [&netif] (const auto& rule) { return doesNetifMatchRule(netif, rule); });
 }
 
 static bool
@@ -219,8 +221,10 @@
 bool
 IpAddressPredicate::operator()(const boost::asio::ip::address& address) const
 {
-  return std::any_of(m_whitelist.begin(), m_whitelist.end(), bind(&doesAddressMatchRule, std::cref(address), _1)) &&
-         std::none_of(m_blacklist.begin(), m_blacklist.end(), bind(&doesAddressMatchRule, std::cref(address), _1));
+  return std::any_of(m_whitelist.begin(), m_whitelist.end(),
+                     [&address] (const auto& rule) { return doesAddressMatchRule(address, rule); }) &&
+         std::none_of(m_blacklist.begin(), m_blacklist.end(),
+                      [&address] (const auto& rule) { return doesAddressMatchRule(address, rule); });
 }
 
 } // namespace face
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index f45d786..89e34d5 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.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-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -200,8 +200,9 @@
   if (it != m_channels.end())
     return it->second;
 
-  auto channel = make_shared<TcpChannel>(endpoint, m_wantCongestionMarking,
-                                         bind(&TcpFactory::determineFaceScopeFromAddresses, this, _1, _2));
+  auto channel = make_shared<TcpChannel>(endpoint, m_wantCongestionMarking, [this] (auto&&... args) {
+    return determineFaceScopeFromAddresses(std::forward<decltype(args)>(args)...);
+  });
   m_channels[endpoint] = channel;
   return channel;
 }
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 9eabd42..8f7f77c 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -434,7 +434,7 @@
     NFD_LOG_DEBUG("Not creating multicast faces on " << netif->getName() << ": no viable IP address");
     // keep an eye on new addresses
     m_netifConns[netif->getIndex()].addrAddConn =
-      netif->onAddressAdded.connect([=] (auto...) { this->applyMcastConfigToNetif(netif); });
+      netif->onAddressAdded.connect([=] (auto&&...) { this->applyMcastConfigToNetif(netif); });
     return {};
   }
 
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 13f6f38..957c9ad 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -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-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -53,13 +53,13 @@
     }
     return websocketpp::lib::error_code{};
   });
-  m_server.set_open_handler(bind(&WebSocketChannel::handleOpen, this, _1));
-  m_server.set_close_handler(bind(&WebSocketChannel::handleClose, this, _1));
-  m_server.set_message_handler(bind(&WebSocketChannel::handleMessage, this, _1, _2));
+  m_server.set_open_handler(std::bind(&WebSocketChannel::handleOpen, this, _1));
+  m_server.set_close_handler(std::bind(&WebSocketChannel::handleClose, this, _1));
+  m_server.set_message_handler(std::bind(&WebSocketChannel::handleMessage, this, _1, _2));
 
   // Detect disconnections using ping-pong messages
-  m_server.set_pong_handler(bind(&WebSocketChannel::handlePong, this, _1));
-  m_server.set_pong_timeout_handler(bind(&WebSocketChannel::handlePongTimeout, this, _1));
+  m_server.set_pong_handler(std::bind(&WebSocketChannel::handlePong, this, _1));
+  m_server.set_pong_timeout_handler(std::bind(&WebSocketChannel::handlePongTimeout, this, _1));
 
   // Always set SO_REUSEADDR flag
   m_server.set_reuse_addr(true);
