mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 09:47:43 +08:00
Make the current unit tests pass
This commit is contained in:
parent
9955f9e469
commit
afe1a3298e
@ -209,6 +209,11 @@ private:
|
||||
detail::container::flat_variant<surrogate_t, exception_t> variant_;
|
||||
};
|
||||
|
||||
inline result<> make_result() {
|
||||
result<> result;
|
||||
result.set_value();
|
||||
return result;
|
||||
}
|
||||
template <typename... T>
|
||||
auto make_result(T&&... values) {
|
||||
return result<detail::traits::unrefcv_t<T>...>(std::forward<T>(values)...);
|
||||
|
||||
@ -361,7 +361,8 @@ private:
|
||||
detail::slot_t get_slot() const noexcept {
|
||||
// Check for invalid values especially for memory corruption,
|
||||
// the empty element is included.
|
||||
assert(this->slot_ <= sizeof...(T));
|
||||
assert((this->slot_ < sizeof...(T)) ||
|
||||
(this->slot_ == detail::empty_slot::value));
|
||||
return this->slot_;
|
||||
}
|
||||
bool is_slot(detail::slot_t const slot) const noexcept {
|
||||
|
||||
@ -55,7 +55,10 @@ struct result_trait<> {
|
||||
}
|
||||
|
||||
template <typename Result, typename Mapper>
|
||||
static void visit(Result&& /*result*/, Mapper&& /*mapper*/) {
|
||||
static auto visit(Result&& result, Mapper&& mapper) {
|
||||
assert(result.is_value());
|
||||
(void)result;
|
||||
return util::invoke(std::forward<Mapper>(mapper));
|
||||
}
|
||||
};
|
||||
template <typename T>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user