From f6e6b8905be010d7329316cea4546900ad8a2d19 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 29 Apr 2014 21:50:13 +0200 Subject: Use C++14 string_literals --- src/network/socket_handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/socket_handler.cpp b/src/network/socket_handler.cpp index 546b1b4..f1b70be 100644 --- a/src/network/socket_handler.cpp +++ b/src/network/socket_handler.cpp @@ -42,7 +42,7 @@ void SocketHandler::init_socket() const int existing_flags = ::fcntl(this->socket, F_GETFL, 0); if ((existing_flags == -1) || (::fcntl(this->socket, F_SETFL, existing_flags | O_NONBLOCK) == -1)) - throw std::runtime_error(std::string("Could not initialize socket: ") + strerror(errno)); + throw std::runtime_error("Could not initialize socket: "s + strerror(errno)); } void SocketHandler::connect(const std::string& address, const std::string& port) @@ -70,7 +70,7 @@ void SocketHandler::connect(const std::string& address, const std::string& port) if (res != 0) { - log_warning(std::string("getaddrinfo failed: ") + gai_strerror(res)); + log_warning("getaddrinfo failed: "s + gai_strerror(res)); this->close(); this->on_connection_failed(gai_strerror(res)); return ; -- cgit v1.2.3