mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
More
This commit is contained in:
parent
0f5dd265fd
commit
b18f78c6be
@ -38,8 +38,8 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include <continuable/continuable-promise-base.hpp>
|
||||
#include <continuable/continuable-api.hpp>
|
||||
#include <continuable/continuable-promise-base.hpp>
|
||||
#include <continuable/detail/base.hpp>
|
||||
#include <continuable/detail/hints.hpp>
|
||||
#include <continuable/detail/traits.hpp>
|
||||
@ -431,7 +431,7 @@ template <typename Data>
|
||||
auto finalize_composition(
|
||||
continuable_base<Data, strategy_any_tag>&& continuation) {
|
||||
|
||||
auto ownership_ = base::attorney::ownership_of(continuation);
|
||||
auto ownership = base::attorney::ownership_of(continuation);
|
||||
|
||||
auto composition = base::attorney::consume_data(std::move(continuation));
|
||||
|
||||
@ -458,7 +458,7 @@ auto finalize_composition(
|
||||
submitter->create_callback());
|
||||
});
|
||||
},
|
||||
signature, std::move(ownership_));
|
||||
signature, std::move(ownership));
|
||||
}
|
||||
|
||||
/// Connects the left and the right continuable to a sequence
|
||||
|
||||
@ -88,7 +88,7 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
template <bool IsCopyable, typename Base>
|
||||
template <bool IsCopyable /*= true */, typename Base>
|
||||
struct expected_base : expected_base_util<Base> {
|
||||
explicit expected_base(expected_base const& right) {
|
||||
right.visit([&](auto&& value) {
|
||||
@ -102,6 +102,24 @@ struct expected_base : expected_base_util<Base> {
|
||||
this->init(std::forward<decltype(value)>(value));
|
||||
});
|
||||
set(right.consume());
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
template <bool IsCopyable /*= true */, typename Base>
|
||||
struct expected_base : expected_base_util<Base> {
|
||||
explicit expected_base(expected_base const& right) {
|
||||
right.visit([&](auto&& value) {
|
||||
this->init(std::forward<decltype(value)>(value));
|
||||
});
|
||||
set(right.consume());
|
||||
}
|
||||
expected_base& operator=(expected_base const& right) {
|
||||
this->weak_destroy();
|
||||
right.visit([&](auto&& value) {
|
||||
this->init(std::forward<decltype(value)>(value));
|
||||
});
|
||||
set(right.consume());
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user