From 1c43415240ce9f66e3f474dbefdf9aae8f2c6dcc Mon Sep 17 00:00:00 2001 From: colbysparks Date: Mon, 29 Jul 2024 17:37:56 -0700 Subject: [PATCH] Delete assignment operator which modifies const field --- Rx/v2/src/rxcpp/rx-notification.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rx/v2/src/rxcpp/rx-notification.hpp b/Rx/v2/src/rxcpp/rx-notification.hpp index 330ddb924..6e22d0ae6 100644 --- a/Rx/v2/src/rxcpp/rx-notification.hpp +++ b/Rx/v2/src/rxcpp/rx-notification.hpp @@ -127,7 +127,7 @@ struct notification on_next_notification(const T& value) : value(value) {} on_next_notification(const on_next_notification& o) : value(o.value) {} on_next_notification(const on_next_notification&& o) : value(std::move(o.value)) {} - on_next_notification& operator=(on_next_notification o) { value = std::move(o.value); return *this; } + on_next_notification& operator=(on_next_notification o) { value = std::move(o.value); return *this; }; void out(std::ostream& os) const override { os << "on_next( "; detail::to_stream(os, value, 0, 0); @@ -155,7 +155,7 @@ struct notification } on_error_notification(const on_error_notification& o) : ep(o.ep) {} on_error_notification(const on_error_notification&& o) : ep(std::move(o.ep)) {} - on_error_notification& operator=(on_error_notification o) { ep = std::move(o.ep); return *this; } + on_error_notification& operator=(on_error_notification o) RXCPP_DELETE; void out(std::ostream& os) const override { os << "on_error("; os << rxu::what(ep); @@ -274,7 +274,7 @@ std::ostream& operator<< (std::ostream& out, const recorded& r) { out << "@" << r.time() << "-" << r.value(); return out; } - + } namespace rxn=notifications;