We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 320f736 commit 55d13fcCopy full SHA for 55d13fc
Rx/v2/src/rxcpp/rx-util.hpp
@@ -637,19 +637,19 @@ class maybe
637
638
template<class U = T>
639
void reset(U&& value) {
640
- *this = std::forward<U>(value);
+ val_.emplace(std::forward<U>(value));
641
}
642
643
maybe& operator=(const maybe& other) = default;
644
maybe& operator=(maybe&& other) = default;
645
646
maybe& operator=(const T& value) {
647
- val_ = value;
+ reset(value);
648
return *this;
649
650
651
maybe& operator=(T&& value) {
652
- val_ = std::move(value);
+ reset(std::move(value));
653
654
655
};
0 commit comments