src: Remove unnecessary uses of boost::cref in make_shared and replace boost::cref/boost::ref with just cref/ref

In some cases, due to argument-dependent lookup, it is necessary to use
ndn::ref, instead of just ref.

Change-Id: I682180a007609535855f77511b49622154ad4f11
Refs: #1591
diff --git a/tests/daemon/face/packet-datasets.cpp b/tests/daemon/face/packet-datasets.cpp
index 86e01cd..cf661db 100644
--- a/tests/daemon/face/packet-datasets.cpp
+++ b/tests/daemon/face/packet-datasets.cpp
@@ -33,7 +33,7 @@
 
 BOOST_FIXTURE_TEST_SUITE(Datasets, BaseFixture)
 
-BOOST_AUTO_TEST_CASE(Currupted)
+BOOST_AUTO_TEST_CASE(Corrupted)
 {
   {
     typedef CorruptedInterest Dataset;
diff --git a/tests/daemon/face/unix-stream.cpp b/tests/daemon/face/unix-stream.cpp
index 06ff5d3..7d86f39 100644
--- a/tests/daemon/face/unix-stream.cpp
+++ b/tests/daemon/face/unix-stream.cpp
@@ -157,8 +157,7 @@
   channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
 
-  shared_ptr<stream_protocol::socket> client =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client = make_shared<stream_protocol::socket>(ref(g_io));
   client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                         bind(&EndToEndFixture::client_onConnect, this, _1));
 
@@ -228,8 +227,7 @@
   channel->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
                   bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
 
-  shared_ptr<stream_protocol::socket> client1 =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client1 = make_shared<stream_protocol::socket>(ref(g_io));
   client1->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                          bind(&EndToEndFixture::client_onConnect, this, _1));
 
@@ -238,8 +236,7 @@
 
   BOOST_CHECK_EQUAL(faces.size(), 1);
 
-  shared_ptr<stream_protocol::socket> client2 =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client2 = make_shared<stream_protocol::socket>(ref(g_io));
   client2->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                          bind(&EndToEndFixture::client_onConnect, this, _1));
 
@@ -297,8 +294,7 @@
   channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
 
-  shared_ptr<stream_protocol::socket> client =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client = make_shared<stream_protocol::socket>(ref(g_io));
   client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                         bind(&EndToEndFixture::client_onConnect, this, _1));
 
diff --git a/tests/daemon/fw/face-table.cpp b/tests/daemon/fw/face-table.cpp
index daf9256..3f49525 100644
--- a/tests/daemon/fw/face-table.cpp
+++ b/tests/daemon/fw/face-table.cpp
@@ -46,8 +46,8 @@
   FaceTable& faceTable = forwarder.getFaceTable();
   std::vector<FaceId> onAddHistory;
   std::vector<FaceId> onRemoveHistory;
-  faceTable.onAdd    += bind(&saveFaceId, boost::ref(onAddHistory   ), _1);
-  faceTable.onRemove += bind(&saveFaceId, boost::ref(onRemoveHistory), _1);
+  faceTable.onAdd    += bind(&saveFaceId, ndn::ref(onAddHistory   ), _1);
+  faceTable.onRemove += bind(&saveFaceId, ndn::ref(onRemoveHistory), _1);
 
   shared_ptr<Face> face1 = make_shared<DummyFace>();
   shared_ptr<Face> face2 = make_shared<DummyFace>();
diff --git a/tests/daemon/fw/forwarder.cpp b/tests/daemon/fw/forwarder.cpp
index 0151460..0b72a0d 100644
--- a/tests/daemon/fw/forwarder.cpp
+++ b/tests/daemon/fw/forwarder.cpp
@@ -300,9 +300,9 @@
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   shared_ptr<DummyStrategy> strategyP = make_shared<DummyStrategy>(
-                                        boost::ref(forwarder), "ndn:/strategyP");
+                                        ref(forwarder), "ndn:/strategyP");
   shared_ptr<DummyStrategy> strategyQ = make_shared<DummyStrategy>(
-                                        boost::ref(forwarder), "ndn:/strategyQ");
+                                        ref(forwarder), "ndn:/strategyQ");
   strategyChoice.install(strategyP);
   strategyChoice.install(strategyQ);
   strategyChoice.insert("ndn:/" , strategyP->getName());
diff --git a/tests/daemon/fw/ncc-strategy.cpp b/tests/daemon/fw/ncc-strategy.cpp
index 29db3b3..9e1f7bc 100644
--- a/tests/daemon/fw/ncc-strategy.cpp
+++ b/tests/daemon/fw/ncc-strategy.cpp
@@ -43,7 +43,7 @@
   LimitedIo limitedIo;
   Forwarder forwarder;
   typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
-  shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(boost::ref(forwarder));
+  shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(ref(forwarder));
   strategy->onAction += bind(&LimitedIo::afterOp, &limitedIo);
 
   shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
diff --git a/tests/daemon/mgmt/command-validator.cpp b/tests/daemon/mgmt/command-validator.cpp
index 834cc5b..5e1dd30 100644
--- a/tests/daemon/mgmt/command-validator.cpp
+++ b/tests/daemon/mgmt/command-validator.cpp
@@ -230,21 +230,21 @@
   config.parse(CONFIG, false, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidated());
   m_tester2.resetValidation();
@@ -254,8 +254,8 @@
   generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
 
   validator.validate(*unauthorizedFibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
 }
@@ -290,21 +290,21 @@
   config.parse(CONFIG, true, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
   m_tester2.resetValidation();
@@ -314,8 +314,8 @@
   generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
 
   validator.validate(*unauthorizedFibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
 }
@@ -629,25 +629,22 @@
   config.parse(WILDCARD_CERT_CONFIG, false, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed,
-                          boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed,
-                          boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed,
-                          boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
index 14b62d4..974e417 100644
--- a/tests/daemon/mgmt/face-manager.cpp
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -1591,8 +1591,8 @@
                    .setFlags(0);
 
   getFace()->onReceiveData +=
-    bind(&FaceFixture::callbackDispatch, this, _1,
-         command->getName(), 200, "Success", boost::ref(encodedParameters), expectedFaceEvent);
+    bind(&FaceFixture::callbackDispatch, this, _1, command->getName(),
+         200, "Success", ref(encodedParameters), expectedFaceEvent);
 
   destroyFace(*command, parameters);
 
diff --git a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
index d972d79..301d396 100644
--- a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
+++ b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
@@ -125,8 +125,8 @@
 
     std::set<shared_ptr<fib::Entry> >::const_iterator referenceIter =
       std::find_if(m_referenceEntries.begin(), m_referenceEntries.end(),
-                   boost::bind(&FibEnumerationPublisherFixture::entryHasPrefix,
-                               this, _1, prefix));
+                   bind(&FibEnumerationPublisherFixture::entryHasPrefix,
+                        this, _1, prefix));
 
     BOOST_REQUIRE(referenceIter != m_referenceEntries.end());
 
diff --git a/tests/daemon/mgmt/fib-manager.cpp b/tests/daemon/mgmt/fib-manager.cpp
index b38c3b8..2305c2c 100644
--- a/tests/daemon/mgmt/fib-manager.cpp
+++ b/tests/daemon/mgmt/fib-manager.cpp
@@ -160,10 +160,8 @@
   }
 
 protected:
-    FibManagerFixture()
-      : m_manager(boost::ref(m_fib),
-                  bind(&FibManagerFixture::getFace, this, _1),
-                  m_face)
+  FibManagerFixture()
+    : m_manager(ref(m_fib), bind(&FibManagerFixture::getFace, this, _1), m_face)
     , m_callbackFired(false)
   {
   }
diff --git a/tests/daemon/mgmt/internal-face.cpp b/tests/daemon/mgmt/internal-face.cpp
index 04ef4a2..e76d80f 100644
--- a/tests/daemon/mgmt/internal-face.cpp
+++ b/tests/daemon/mgmt/internal-face.cpp
@@ -108,7 +108,7 @@
 
   bool didPutData = false;
   Name dataName("/hello");
-  face->onReceiveData += bind(&validatePutData, boost::ref(didPutData), dataName, _1);
+  face->onReceiveData += bind(&validatePutData, ref(didPutData), dataName, _1);
 
   Data testData(dataName);
   face->sign(testData);
diff --git a/tests/daemon/mgmt/status-server.cpp b/tests/daemon/mgmt/status-server.cpp
index 75b4114..d9f3129 100644
--- a/tests/daemon/mgmt/status-server.cpp
+++ b/tests/daemon/mgmt/status-server.cpp
@@ -50,7 +50,7 @@
   Forwarder forwarder;
   shared_ptr<InternalFace> internalFace = make_shared<InternalFace>();
   internalFace->onReceiveData += &interceptResponse;
-  StatusServer statusServer(internalFace, boost::ref(forwarder));
+  StatusServer statusServer(internalFace, ref(forwarder));
   time::system_clock::TimePoint t2 = time::system_clock::now();
 
   // populate tables
diff --git a/tests/daemon/mgmt/strategy-choice-manager.cpp b/tests/daemon/mgmt/strategy-choice-manager.cpp
index 99d5636..9b5f2c5 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.cpp
@@ -50,7 +50,8 @@
     , m_manager(m_strategyChoice, m_face)
     , m_callbackFired(false)
   {
-    m_strategyChoice.install(make_shared<DummyStrategy>(boost::ref(m_forwarder), "/localhost/nfd/strategy/test-strategy-a"));
+    m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
+                                                        "/localhost/nfd/strategy/test-strategy-a"));
     m_strategyChoice.insert("ndn:/", "/localhost/nfd/strategy/test-strategy-a");
   }
 
@@ -169,7 +170,8 @@
 public:
   AllStrategiesFixture()
   {
-    m_strategyChoice.install(make_shared<DummyStrategy>(boost::ref(m_forwarder), "/localhost/nfd/strategy/test-strategy-b"));
+    m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
+                                                        "/localhost/nfd/strategy/test-strategy-b"));
   }
 
   virtual
diff --git a/tests/daemon/table/measurements-accessor.cpp b/tests/daemon/table/measurements-accessor.cpp
index 6dc8ff3..cbcbe5a 100644
--- a/tests/daemon/table/measurements-accessor.cpp
+++ b/tests/daemon/table/measurements-accessor.cpp
@@ -68,9 +68,9 @@
   Forwarder forwarder;
 
   shared_ptr<MeasurementsAccessorTestStrategy> strategy1 =
-    make_shared<MeasurementsAccessorTestStrategy>(boost::ref(forwarder), "ndn:/strategy1");
+    make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy1");
   shared_ptr<MeasurementsAccessorTestStrategy> strategy2 =
-    make_shared<MeasurementsAccessorTestStrategy>(boost::ref(forwarder), "ndn:/strategy2");
+    make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy2");
 
   Name nameRoot("ndn:/");
   Name nameA   ("ndn:/A");
diff --git a/tests/daemon/table/strategy-choice.cpp b/tests/daemon/table/strategy-choice.cpp
index 6927375..3f8c2bc 100644
--- a/tests/daemon/table/strategy-choice.cpp
+++ b/tests/daemon/table/strategy-choice.cpp
@@ -40,8 +40,8 @@
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   Name nameZ("ndn:/strategy/Z");
-  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(boost::ref(forwarder), nameP);
-  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(boost::ref(forwarder), nameQ);
+  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
+  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
 
   StrategyChoice& table = forwarder.getStrategyChoice();
 
@@ -110,8 +110,8 @@
   Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
-  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(boost::ref(forwarder), nameP);
-  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(boost::ref(forwarder), nameQ);
+  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
+  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
 
   StrategyChoice& table = forwarder.getStrategyChoice();
   Measurements& measurements = forwarder.getMeasurements();