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

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-14 15:54:55 +09:00
parent 98add63cdf
commit 8ea26fddfd
3 changed files with 8 additions and 7 deletions

View File

@ -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:
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();

View File

@ -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:
// 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:
// 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_;

View File

@ -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:
// 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;