]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1308] Less _1 ambiguities
authorFrancis Dupont <fdupont@isc.org>
Fri, 31 Jul 2020 17:42:11 +0000 (19:42 +0200)
committerTomek Mrugalski <tomek@isc.org>
Thu, 13 Aug 2020 13:54:14 +0000 (13:54 +0000)
src/lib/asiodns/tests/io_fetch_unittest.cc
src/lib/config/base_command_mgr.cc
src/lib/config/command_mgr.cc
src/lib/dhcpsrv/alloc_engine.cc

index 12d139765b12d63c65fb8b113ea0388e5657ce1f..628e8fd34bc2aabb20df58b56f7b9f3a8e4d568c 100644 (file)
@@ -36,8 +36,8 @@ using namespace boost::asio;
 using namespace isc::asiolink;
 using namespace isc::dns;
 using namespace isc::util;
-using namespace std::placeholders;
 using namespace std;
+namespace ph = std::placeholders;
 
 namespace isc {
 namespace asiodns {
@@ -242,7 +242,7 @@ public:
         // Initiate a read on the socket.
         cumulative_ = 0;
         socket->async_receive(boost::asio::buffer(receive_buffer_, sizeof(receive_buffer_)),
-            std::bind(&IOFetchTest::tcpReceiveHandler, this, socket, _1, _2));
+            std::bind(&IOFetchTest::tcpReceiveHandler, this, socket, ph::_1, ph::_2));
     }
 
     /// \brief Completion handler for receiving TCP data
@@ -279,7 +279,7 @@ public:
         if (!complete) {
             socket->async_receive(boost::asio::buffer((receive_buffer_ + cumulative_),
                 (sizeof(receive_buffer_) - cumulative_)),
-                std::bind(&IOFetchTest::tcpReceiveHandler, this, socket, _1, _2));
+                std::bind(&IOFetchTest::tcpReceiveHandler, this, socket, ph::_1, ph::_2));
             return;
         }
 
@@ -368,7 +368,7 @@ public:
         // argument of the send callback, as a check.
         socket->async_send(boost::asio::buffer(send_ptr, amount),
                            std::bind(&IOFetchTest::tcpSendHandler, this,
-                                     amount, socket, _1, _2));
+                                     amount, socket, ph::_1, ph::_2));
     }
 
     /// \brief Completion Handler for Sending TCP data
@@ -550,7 +550,7 @@ public:
         tcp::acceptor acceptor(service_.get_io_service(),
                                tcp::endpoint(tcp::v4(), TEST_PORT));
         acceptor.async_accept(socket,
-            std::bind(&IOFetchTest::tcpAcceptHandler, this, &socket, _1));
+            std::bind(&IOFetchTest::tcpAcceptHandler, this, &socket, ph::_1));
 
         // Post the TCP fetch object to send the query and receive the response.
         service_.get_io_service().post(tcp_fetch_);
@@ -586,7 +586,7 @@ public:
                                   remote,
                                   std::bind(&IOFetchTest::udpReceiveHandler,
                                             this, &remote, &socket,
-                                            _1, _2, bad_qid, second_send));
+                                            ph::_1, ph::_2, bad_qid, second_send));
         service_.get_io_service().post(udp_fetch_);
         if (debug_) {
             cout << "udpSendReceive: async_receive_from posted,"
index 324c2397280334a71017986aa983fee77c031d6b..62eac5264dbc9d0dcd8884fc593d95df68690e0b 100644 (file)
@@ -15,7 +15,7 @@
 
 using namespace isc::data;
 using namespace isc::hooks;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -42,7 +42,7 @@ namespace config {
 
 BaseCommandMgr::BaseCommandMgr() {
     registerCommand("list-commands", std::bind(&BaseCommandMgr::listCommandsHandler,
-                                               this, _1, _2));
+                                               this, ph::_1, ph::_2));
 }
 
 void
@@ -108,7 +108,7 @@ BaseCommandMgr::deregisterAll() {
     // code, just in tests.
     handlers_.clear();
     registerCommand("list-commands",
-        std::bind(&BaseCommandMgr::listCommandsHandler, this, _1, _2));
+        std::bind(&BaseCommandMgr::listCommandsHandler, this, ph::_1, ph::_2));
 }
 
 isc::data::ConstElementPtr
index 34f76103bc4904cb23a62efefe7cea430d259f33..39cd471db74c06dc7ba5d53820154fb0dee079c3 100644 (file)
@@ -30,7 +30,7 @@ using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
 using namespace isc::data;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -139,7 +139,7 @@ public:
     void doReceive() {
         socket_->asyncReceive(&buf_[0], sizeof(buf_),
                               std::bind(&Connection::receiveHandler,
-                                        shared_from_this(), _1, _2));
+                                        shared_from_this(), ph::_1, ph::_2));
     }
 
     /// @brief Starts asynchronous send over the unix domain socket.
@@ -152,7 +152,7 @@ public:
     void doSend() {
         size_t chunk_size = (response_.size() < BUF_SIZE) ? response_.size() : BUF_SIZE;
         socket_->asyncSend(&response_[0], chunk_size,
-           std::bind(&Connection::sendHandler, shared_from_this(), _1, _2));
+           std::bind(&Connection::sendHandler, shared_from_this(), ph::_1, ph::_2));
 
         // Asynchronous send has been scheduled and we need to indicate this
         // to break the synchronous select(). The handler should clear this
index e1c3e69aea1642865725b459769bd1016e560359..c63e9093a974ac3b2a2b846fa7fc48260479f963 100644 (file)
@@ -50,7 +50,7 @@ using namespace isc::hooks;
 using namespace isc::stats;
 using namespace isc::util;
 using namespace isc::data;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -2597,7 +2597,7 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease,
             LeaseMgr& lease_mgr = LeaseMgrFactory::instance();
             reclaimLeaseInDatabase<Lease6Ptr>(lease, remove_lease,
                                               std::bind(&LeaseMgr::updateLease6,
-                                                        &lease_mgr, _1));
+                                                        &lease_mgr, ph::_1));
         }
     }
 
@@ -2693,7 +2693,7 @@ AllocEngine::reclaimExpiredLease(const Lease4Ptr& lease,
             LeaseMgr& lease_mgr = LeaseMgrFactory::instance();
             reclaimLeaseInDatabase<Lease4Ptr>(lease, remove_lease,
                                               std::bind(&LeaseMgr::updateLease4,
-                                                        &lease_mgr, _1));
+                                                        &lease_mgr, ph::_1));
         }
     }