From: Francis Dupont Date: Fri, 31 Jul 2020 17:42:11 +0000 (+0200) Subject: [#1308] Less _1 ambiguities X-Git-Tag: Kea-1.8.0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03cef674c6f06d39ea049ba34ed80006f84d9cdc;p=thirdparty%2Fkea.git [#1308] Less _1 ambiguities --- diff --git a/src/lib/asiodns/tests/io_fetch_unittest.cc b/src/lib/asiodns/tests/io_fetch_unittest.cc index 12d139765b..628e8fd34b 100644 --- a/src/lib/asiodns/tests/io_fetch_unittest.cc +++ b/src/lib/asiodns/tests/io_fetch_unittest.cc @@ -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," diff --git a/src/lib/config/base_command_mgr.cc b/src/lib/config/base_command_mgr.cc index 324c239728..62eac5264d 100644 --- a/src/lib/config/base_command_mgr.cc +++ b/src/lib/config/base_command_mgr.cc @@ -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 diff --git a/src/lib/config/command_mgr.cc b/src/lib/config/command_mgr.cc index 34f76103bc..39cd471db7 100644 --- a/src/lib/config/command_mgr.cc +++ b/src/lib/config/command_mgr.cc @@ -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 diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index e1c3e69aea..c63e9093a9 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -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(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(lease, remove_lease, std::bind(&LeaseMgr::updateLease4, - &lease_mgr, _1)); + &lease_mgr, ph::_1)); } }