From c5cfa5b86cf4e239f459c357969aeb7dd517bd62 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 10 Jul 2018 17:29:27 +0200 Subject: [PATCH] Added underscore on constructor parameters that are moved --- client_http.hpp | 24 ++++++++++++------------ server_http.hpp | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client_http.hpp b/client_http.hpp index be8d023..d3e375c 100644 --- a/client_http.hpp +++ b/client_http.hpp @@ -116,8 +116,8 @@ namespace SimpleWeb { class Connection : public std::enable_shared_from_this { public: template - Connection(std::shared_ptr handler_runner, long timeout, Args &&... args) noexcept - : handler_runner(std::move(handler_runner)), timeout(timeout), socket(new socket_type(std::forward(args)...)) {} + Connection(std::shared_ptr handler_runner_, long timeout, Args &&... args) noexcept + : handler_runner(std::move(handler_runner_)), timeout(timeout), socket(new socket_type(std::forward(args)...)) {} std::shared_ptr handler_runner; long timeout; @@ -156,8 +156,8 @@ namespace SimpleWeb { class Session { public: - Session(std::size_t max_response_streambuf_size, std::shared_ptr connection, std::unique_ptr request_streambuf) noexcept - : connection(std::move(connection)), request_streambuf(std::move(request_streambuf)), response(new Response(max_response_streambuf_size)) {} + Session(std::size_t max_response_streambuf_size, std::shared_ptr connection, std::unique_ptr request_streambuf_) noexcept + : connection(std::move(connection)), request_streambuf(std::move(request_streambuf_)), response(new Response(max_response_streambuf_size)) {} std::shared_ptr connection; std::unique_ptr request_streambuf; @@ -284,19 +284,19 @@ namespace SimpleWeb { /// Asynchronous request where setting and/or running Client's io_service is required. /// Do not use concurrently with the synchronous request functions. void request(const std::string &method, const std::string &path, string_view content, - std::function, const error_code &)> &&request_callback) { - request(method, path, content, CaseInsensitiveMultimap(), std::move(request_callback)); + std::function, const error_code &)> &&request_callback_) { + request(method, path, content, CaseInsensitiveMultimap(), std::move(request_callback_)); } /// Asynchronous request where setting and/or running Client's io_service is required. void request(const std::string &method, const std::string &path, - std::function, const error_code &)> &&request_callback) { - request(method, path, std::string(), CaseInsensitiveMultimap(), std::move(request_callback)); + std::function, const error_code &)> &&request_callback_) { + request(method, path, std::string(), CaseInsensitiveMultimap(), std::move(request_callback_)); } /// Asynchronous request where setting and/or running Client's io_service is required. - void request(const std::string &method, std::function, const error_code &)> &&request_callback) { - request(method, std::string("/"), std::string(), CaseInsensitiveMultimap(), std::move(request_callback)); + void request(const std::string &method, std::function, const error_code &)> &&request_callback_) { + request(method, std::string("/"), std::string(), CaseInsensitiveMultimap(), std::move(request_callback_)); } /// Asynchronous request where setting and/or running Client's io_service is required. @@ -352,8 +352,8 @@ namespace SimpleWeb { /// Asynchronous request where setting and/or running Client's io_service is required. void request(const std::string &method, const std::string &path, std::istream &content, - std::function, const error_code &)> &&request_callback) { - request(method, path, content, CaseInsensitiveMultimap(), std::move(request_callback)); + std::function, const error_code &)> &&request_callback_) { + request(method, path, content, CaseInsensitiveMultimap(), std::move(request_callback_)); } /// Close connections diff --git a/server_http.hpp b/server_http.hpp index 1032766..b6a6d33 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -228,8 +228,8 @@ namespace SimpleWeb { asio::streambuf streambuf; - Request(std::size_t max_request_streambuf_size, std::shared_ptr remote_endpoint) noexcept - : streambuf(max_request_streambuf_size), content(streambuf), remote_endpoint(std::move(remote_endpoint)) {} + Request(std::size_t max_request_streambuf_size, std::shared_ptr remote_endpoint_) noexcept + : streambuf(max_request_streambuf_size), content(streambuf), remote_endpoint(std::move(remote_endpoint_)) {} public: std::string method, path, query_string, http_version; @@ -268,7 +268,7 @@ namespace SimpleWeb { class Connection : public std::enable_shared_from_this { public: template - Connection(std::shared_ptr handler_runner, Args &&... args) noexcept : handler_runner(std::move(handler_runner)), socket(new socket_type(std::forward(args)...)) {} + Connection(std::shared_ptr handler_runner_, Args &&... args) noexcept : handler_runner(std::move(handler_runner_)), socket(new socket_type(std::forward(args)...)) {} std::shared_ptr handler_runner; @@ -311,7 +311,7 @@ namespace SimpleWeb { class Session { public: - Session(std::size_t max_request_streambuf_size, std::shared_ptr connection) noexcept : connection(std::move(connection)) { + Session(std::size_t max_request_streambuf_size, std::shared_ptr connection_) noexcept : connection(std::move(connection_)) { if(!this->connection->remote_endpoint) { error_code ec; this->connection->remote_endpoint = std::make_shared(this->connection->socket->lowest_layer().remote_endpoint(ec)); @@ -357,7 +357,7 @@ namespace SimpleWeb { public: regex_orderable(const char *regex_cstr) : regex::regex(regex_cstr), str(regex_cstr) {} - regex_orderable(std::string regex_str) : regex::regex(regex_str), str(std::move(regex_str)) {} + regex_orderable(std::string regex_str_) : regex::regex(regex_str_), str(std::move(regex_str_)) {} bool operator<(const regex_orderable &rhs) const noexcept { return str < rhs.str; }