Use C++14 string_literals

This commit is contained in:
Florent Le Coz
2014-04-29 21:50:13 +02:00
parent 594bac1e84
commit f6e6b8905b
4 changed files with 22 additions and 15 deletions
+2 -2
View File
@@ -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 ;