From 773b108eeb21f08cafe5f60bced96416c5ae4bca Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 7 Mar 2015 00:32:39 +0900 Subject: [PATCH] asio: Add noexcept for move constructor and move assignment operator --- src/asio_client_session.cc | 4 ++-- src/asio_server_http2.cc | 4 ++-- src/includes/nghttp2/asio_http2_client.h | 4 ++-- src/includes/nghttp2/asio_http2_server.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/asio_client_session.cc b/src/asio_client_session.cc index bc6a46aa..aaee1e77 100644 --- a/src/asio_client_session.cc +++ b/src/asio_client_session.cc @@ -49,9 +49,9 @@ session::session(boost::asio::io_service &io_service, session::~session() {} -session::session(session &&other) : impl_(std::move(other.impl_)) {} +session::session(session &&other) noexcept : impl_(std::move(other.impl_)) {} -session &session::operator=(session &&other) { +session &session::operator=(session &&other) noexcept { if (this == &other) { return *this; } diff --git a/src/asio_server_http2.cc b/src/asio_server_http2.cc index e33b38ef..92bc8898 100644 --- a/src/asio_server_http2.cc +++ b/src/asio_server_http2.cc @@ -40,9 +40,9 @@ http2::http2() : impl_(make_unique()) {} http2::~http2() {} -http2::http2(http2 &&other) : impl_(std::move(other.impl_)) {} +http2::http2(http2 &&other) noexcept : impl_(std::move(other.impl_)) {} -http2 &http2::operator=(http2 &&other) { +http2 &http2::operator=(http2 &&other) noexcept { if (this == &other) { return *this; } diff --git a/src/includes/nghttp2/asio_http2_client.h b/src/includes/nghttp2/asio_http2_client.h index 0693a70a..5d5b2c2a 100644 --- a/src/includes/nghttp2/asio_http2_client.h +++ b/src/includes/nghttp2/asio_http2_client.h @@ -128,8 +128,8 @@ public: const std::string &service); ~session(); - session(session &&other); - session &operator=(session &&other); + session(session &&other) noexcept; + session &operator=(session &&other) noexcept; // Sets callback which is invoked after connection is established. void on_connect(connect_cb cb) const; diff --git a/src/includes/nghttp2/asio_http2_server.h b/src/includes/nghttp2/asio_http2_server.h index c43408cc..311e65a7 100644 --- a/src/includes/nghttp2/asio_http2_server.h +++ b/src/includes/nghttp2/asio_http2_server.h @@ -126,8 +126,8 @@ public: http2(); ~http2(); - http2(http2 &&other); - http2 &operator=(http2 &&other); + http2(http2 &&other) noexcept; + http2 &operator=(http2 &&other) noexcept; // Starts listening connection on given address and port and serves // incoming requests in cleartext TCP connection.