From 8ea26fddfd141f76f02ff0c363a254d79ce1a3fb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 14 Mar 2015 15:54:55 +0900 Subject: [PATCH] Fix compile error "chosen constructor is explicit in copy-initialization" --- src/asio_server_response_impl.h | 4 ++-- src/includes/nghttp2/asio_http2_client.h | 6 +++--- src/includes/nghttp2/asio_http2_server.h | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/asio_server_response_impl.h b/src/asio_server_response_impl.h index 8955968a..41df7a62 100644 --- a/src/asio_server_response_impl.h +++ b/src/asio_server_response_impl.h @@ -46,7 +46,7 @@ enum class response_state { class response_impl { public: response_impl(); - void write_head(unsigned int status_code, header_map h = {}); + void write_head(unsigned int status_code, header_map h = header_map{}); void end(std::string data = ""); void end(generator_cb cb); void write_trailer(header_map h); @@ -56,7 +56,7 @@ public: void cancel(uint32_t error_code); response *push(boost::system::error_code &ec, std::string method, - std::string raw_path_query, header_map h = {}) const; + std::string raw_path_query, header_map) const; boost::asio::io_service &io_service(); diff --git a/src/includes/nghttp2/asio_http2_client.h b/src/includes/nghttp2/asio_http2_client.h index 0f86af98..a2b51ad7 100644 --- a/src/includes/nghttp2/asio_http2_client.h +++ b/src/includes/nghttp2/asio_http2_client.h @@ -156,7 +156,7 @@ public: // succeeds, or nullptr and |ec| contains error message. const request *submit(boost::system::error_code &ec, const std::string &method, const std::string &uri, - header_map h = {}) const; + header_map h = header_map{}) const; // Submits request to server using |method| (e.g., "GET"), |uri| // (e.g., "http://localhost/") and optionally additional header @@ -165,7 +165,7 @@ public: // contains error message. const request *submit(boost::system::error_code &ec, const std::string &method, const std::string &uri, - std::string data, header_map h = {}) const; + std::string data, header_map h = header_map{}) const; // Submits request to server using |method| (e.g., "GET"), |uri| // (e.g., "http://localhost/") and optionally additional header @@ -174,7 +174,7 @@ public: // nullptr and |ec| contains error message. const request *submit(boost::system::error_code &ec, const std::string &method, const std::string &uri, - generator_cb cb, header_map h = {}) const; + generator_cb cb, header_map h = header_map{}) const; private: std::unique_ptr impl_; diff --git a/src/includes/nghttp2/asio_http2_server.h b/src/includes/nghttp2/asio_http2_server.h index 9f5a4b31..bef17336 100644 --- a/src/includes/nghttp2/asio_http2_server.h +++ b/src/includes/nghttp2/asio_http2_server.h @@ -71,7 +71,7 @@ public: // Write response header using |status_code| (e.g., 200) and // additional header fields in |h|. - void write_head(unsigned int status_code, header_map h = {}) const; + void write_head(unsigned int status_code, header_map h = header_map{}) const; // Sends |data| as request body. No further call of end() is // allowed. @@ -103,7 +103,8 @@ public: // nullptr and error code is filled in |ec|. Be aware that the // header field name given in |h| must be lower-cased. const response *push(boost::system::error_code &ec, std::string method, - std::string raw_path_query, header_map h = {}) const; + std::string raw_path_query, + header_map h = header_map{}) const; // Returns status code. unsigned int status_code() const;