diff --git a/Source/.clang-tidy b/Source/.clang-tidy index 753e0a90f..4e1d032f0 100644 --- a/Source/.clang-tidy +++ b/Source/.clang-tidy @@ -32,6 +32,7 @@ # A purely stylistic change that we do not want. # # -modernize-concat-nested-namespaces +# -modernize-avoid-bind # Compatibility with older compilers. Checks: > -*, @@ -47,7 +48,8 @@ Checks: > readability-*, -modernize-avoid-c-arrays, -modernize-use-trailing-return-type, - -modernize-concat-nested-namespaces + -modernize-concat-nested-namespaces, + -modernize-avoid-bind HeaderFilterRegex: "^(Source|test)\\.h$" diff --git a/Source/dvlnet/tcp_client.cpp b/Source/dvlnet/tcp_client.cpp index e91cfa8f4..cf12f8c76 100644 --- a/Source/dvlnet/tcp_client.cpp +++ b/Source/dvlnet/tcp_client.cpp @@ -102,9 +102,7 @@ void tcp_client::start_recv() { sock.async_receive( asio::buffer(recv_buffer), - [this](auto &&PH1, auto &&PH2) { - handle_recv(std::forward(PH1), std::forward(PH2)); - }); + std::bind(&tcp_client::handle_recv, this, std::placeholders::_1, std::placeholders::_2)); } void tcp_client::handle_send(const asio::error_code &error, size_t bytesSent) diff --git a/Source/dvlnet/tcp_server.cpp b/Source/dvlnet/tcp_server.cpp index 4c11fbfcd..ef634dd17 100644 --- a/Source/dvlnet/tcp_server.cpp +++ b/Source/dvlnet/tcp_server.cpp @@ -62,9 +62,7 @@ void tcp_server::start_recv(const scc &con) { con->socket.async_receive( asio::buffer(con->recv_buffer), - [this, con](auto &&PH1, auto &&PH2) { - handle_recv(con, std::forward(PH1), std::forward(PH2)); - }); + std::bind(&tcp_server::handle_recv, this, con, std::placeholders::_1, std::placeholders::_2)); } void tcp_server::handle_recv(const scc &con, const asio::error_code &ec, @@ -160,9 +158,7 @@ void tcp_server::start_accept() auto nextcon = make_connection(); acceptor->async_accept( nextcon->socket, - [this, nextcon](auto &&PH1) { - handle_accept(nextcon, std::forward(PH1)); - }); + std::bind(&tcp_server::handle_accept, this, nextcon, std::placeholders::_1)); } void tcp_server::handle_accept(const scc &con, const asio::error_code &ec) @@ -185,9 +181,7 @@ void tcp_server::start_timeout(const scc &con) { con->timer.expires_after(std::chrono::seconds(1)); con->timer.async_wait( - [this, con](auto &&PH1) { - handle_timeout(con, std::forward(PH1)); - }); + std::bind(&tcp_server::handle_timeout, this, con, std::placeholders::_1)); } void tcp_server::handle_timeout(const scc &con, const asio::error_code &ec)