This commit is contained in:
Denis Blank 2017-11-22 23:38:33 +01:00
parent 0f5dd265fd
commit b18f78c6be
2 changed files with 22 additions and 4 deletions

View File

@ -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

View File

@ -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