Commit 8ea26fdd authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix compile error "chosen constructor is explicit in copy-initialization"

parent 98add63c
...@@ -46,7 +46,7 @@ enum class response_state { ...@@ -46,7 +46,7 @@ enum class response_state {
class response_impl { class response_impl {
public: public:
response_impl(); 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(std::string data = "");
void end(generator_cb cb); void end(generator_cb cb);
void write_trailer(header_map h); void write_trailer(header_map h);
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
void cancel(uint32_t error_code); void cancel(uint32_t error_code);
response *push(boost::system::error_code &ec, std::string method, 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(); boost::asio::io_service &io_service();
......
...@@ -156,7 +156,7 @@ public: ...@@ -156,7 +156,7 @@ public:
// succeeds, or nullptr and |ec| contains error message. // succeeds, or nullptr and |ec| contains error message.
const request *submit(boost::system::error_code &ec, const request *submit(boost::system::error_code &ec,
const std::string &method, const std::string &uri, 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| // Submits request to server using |method| (e.g., "GET"), |uri|
// (e.g., "http://localhost/") and optionally additional header // (e.g., "http://localhost/") and optionally additional header
...@@ -165,7 +165,7 @@ public: ...@@ -165,7 +165,7 @@ public:
// contains error message. // contains error message.
const request *submit(boost::system::error_code &ec, const request *submit(boost::system::error_code &ec,
const std::string &method, const std::string &uri, 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| // Submits request to server using |method| (e.g., "GET"), |uri|
// (e.g., "http://localhost/") and optionally additional header // (e.g., "http://localhost/") and optionally additional header
...@@ -174,7 +174,7 @@ public: ...@@ -174,7 +174,7 @@ public:
// nullptr and |ec| contains error message. // nullptr and |ec| contains error message.
const request *submit(boost::system::error_code &ec, const request *submit(boost::system::error_code &ec,
const std::string &method, const std::string &uri, 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: private:
std::unique_ptr<session_impl> impl_; std::unique_ptr<session_impl> impl_;
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
// Write response header using |status_code| (e.g., 200) and // Write response header using |status_code| (e.g., 200) and
// additional header fields in |h|. // 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 // Sends |data| as request body. No further call of end() is
// allowed. // allowed.
...@@ -103,7 +103,8 @@ public: ...@@ -103,7 +103,8 @@ public:
// nullptr and error code is filled in |ec|. Be aware that the // nullptr and error code is filled in |ec|. Be aware that the
// header field name given in |h| must be lower-cased. // header field name given in |h| must be lower-cased.
const response *push(boost::system::error_code &ec, std::string method, 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. // Returns status code.
unsigned int status_code() const; unsigned int status_code() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment