common: stop importing std::{bind,ref,cref} into namespace ndn
And reduce the usage of std::bind() throughout the codebase.
C++14 lambdas are easier to understand for humans and more
likely to be optimized by the compiler.
Change-Id: Ia59fad34539710f8801c52914896ce426fb7e538
diff --git a/tests/unit/security/certificate-fetcher-from-network.t.cpp b/tests/unit/security/certificate-fetcher-from-network.t.cpp
index caf941a..36a1ae9 100644
--- a/tests/unit/security/certificate-fetcher-from-network.t.cpp
+++ b/tests/unit/security/certificate-fetcher-from-network.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2021 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -65,7 +65,7 @@
interest.setCanBePrefix(false);
m_keyChain.sign(interest, signingByIdentity(subSubIdentity));
- processInterest = bind(&CertificateFetcherFromNetworkFixture<Response>::makeResponse, this, _1);
+ processInterest = [this] (const Interest& i) { makeResponse(i); };
}
void
diff --git a/tests/unit/security/validator-fixture.cpp b/tests/unit/security/validator-fixture.cpp
index 8bb4713..7a7ee14 100644
--- a/tests/unit/security/validator-fixture.cpp
+++ b/tests/unit/security/validator-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2021 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -46,7 +46,7 @@
{
util::signal::ScopedConnection conn = face.onSendInterest.connect([this] (const Interest& interest) {
if (processInterest) {
- m_io.post(bind(processInterest, interest));
+ m_io.post([=] { processInterest(interest); });
}
});
advanceClocks(s_mockPeriod, s_mockTimes);
diff --git a/tests/unit/security/validator-null.t.cpp b/tests/unit/security/validator-null.t.cpp
index 9d04cb8..8fc5a5e 100644
--- a/tests/unit/security/validator-null.t.cpp
+++ b/tests/unit/security/validator-null.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2021 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -28,6 +28,8 @@
namespace security {
namespace tests {
+using std::bind;
+
BOOST_AUTO_TEST_SUITE(Security)
BOOST_FIXTURE_TEST_SUITE(TestValidatorNull, ndn::tests::KeyChainFixture)