From f9ebb5537b4622a96c02dc6fad81c2fe511daa6e Mon Sep 17 00:00:00 2001 From: RnMss Date: Fri, 21 Oct 2022 19:44:05 +0800 Subject: [PATCH 1/2] add default constructor for Subscriber --- src/sw/redis++/async_subscriber.h | 2 ++ src/sw/redis++/subscriber.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/sw/redis++/async_subscriber.h b/src/sw/redis++/async_subscriber.h index 3d8d70d1..dcae0407 100644 --- a/src/sw/redis++/async_subscriber.h +++ b/src/sw/redis++/async_subscriber.h @@ -40,6 +40,8 @@ using SubscribeEventUPtr = std::unique_ptr; class AsyncSubscriber { public: + AsyncSubscriber() = default; + AsyncSubscriber(const AsyncSubscriber &) = delete; AsyncSubscriber& operator=(const AsyncSubscriber &) = delete; diff --git a/src/sw/redis++/subscriber.h b/src/sw/redis++/subscriber.h index b932005f..84535dc4 100644 --- a/src/sw/redis++/subscriber.h +++ b/src/sw/redis++/subscriber.h @@ -62,6 +62,8 @@ namespace redis { // receive the message, and ignore it, i.e. no callback will be called. class Subscriber { public: + Subscriber() = default; + Subscriber(const Subscriber &) = delete; Subscriber& operator=(const Subscriber &) = delete; From 37ae116d422d656aefb198b26d4bc28d34a11bb1 Mon Sep 17 00:00:00 2001 From: RnMss Date: Fri, 21 Oct 2022 19:48:15 +0800 Subject: [PATCH 2/2] Add noexcept for some constructors --- src/sw/redis++/async_subscriber.h | 6 +++--- src/sw/redis++/subscriber.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sw/redis++/async_subscriber.h b/src/sw/redis++/async_subscriber.h index dcae0407..c163a998 100644 --- a/src/sw/redis++/async_subscriber.h +++ b/src/sw/redis++/async_subscriber.h @@ -40,13 +40,13 @@ using SubscribeEventUPtr = std::unique_ptr; class AsyncSubscriber { public: - AsyncSubscriber() = default; + AsyncSubscriber() noexcept = default; AsyncSubscriber(const AsyncSubscriber &) = delete; AsyncSubscriber& operator=(const AsyncSubscriber &) = delete; - AsyncSubscriber(AsyncSubscriber &&) = default; - AsyncSubscriber& operator=(AsyncSubscriber &&) = default; + AsyncSubscriber(AsyncSubscriber &&) noexcept = default; + AsyncSubscriber& operator=(AsyncSubscriber &&) noexcept = default; ~AsyncSubscriber(); diff --git a/src/sw/redis++/subscriber.h b/src/sw/redis++/subscriber.h index 84535dc4..6385d238 100644 --- a/src/sw/redis++/subscriber.h +++ b/src/sw/redis++/subscriber.h @@ -62,13 +62,13 @@ namespace redis { // receive the message, and ignore it, i.e. no callback will be called. class Subscriber { public: - Subscriber() = default; + Subscriber() noexcept = default; Subscriber(const Subscriber &) = delete; Subscriber& operator=(const Subscriber &) = delete; - Subscriber(Subscriber &&) = default; - Subscriber& operator=(Subscriber &&) = default; + Subscriber(Subscriber &&) noexcept = default; + Subscriber& operator=(Subscriber &&) noexcept = default; ~Subscriber() = default;