mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Fix a GCC warning:
```cpp
../include/continuable/detail/expected.hpp:344:44: error: declaration of ‘using expected = class cti::detail::util::expected<cti::detail::util::detail::void_guard_tag>’ [-fpermissive]
using expected = expected<void_guard_tag>;
^
../include/continuable/detail/expected.hpp:171:7: error: changes meaning of ‘expected’ from ‘class cti::detail::util::expected<cti::detail::util::detail::void_guard_tag>’ [-fpermissive]
class expected
```
This commit is contained in:
parent
db8c5b07c9
commit
b17d2f9c17
@ -65,7 +65,7 @@ class awaitable {
|
||||
Continuable continuable_;
|
||||
/// A cache which is used to pass the result of the continuation
|
||||
/// to the coroutine.
|
||||
typename trait_t::expected result_;
|
||||
typename trait_t::expected_type result_;
|
||||
|
||||
public:
|
||||
explicit awaitable(Continuable&& continuable)
|
||||
|
||||
@ -341,37 +341,37 @@ template <typename T>
|
||||
struct expected_result_trait;
|
||||
template <>
|
||||
struct expected_result_trait<traits::identity<>> {
|
||||
using expected = expected<void_guard_tag>;
|
||||
using expected_type = expected<void_guard_tag>;
|
||||
|
||||
static constexpr void_guard_tag wrap() noexcept {
|
||||
return {};
|
||||
}
|
||||
static void unwrap(expected&& e) {
|
||||
static void unwrap(expected_type&& e) {
|
||||
assert(e.is_value());
|
||||
(void)e;
|
||||
}
|
||||
};
|
||||
template <typename T>
|
||||
struct expected_result_trait<traits::identity<T>> {
|
||||
using expected = expected<T>;
|
||||
using expected_type = expected<T>;
|
||||
|
||||
static auto wrap(T arg) {
|
||||
return std::move(arg);
|
||||
}
|
||||
static auto unwrap(expected&& e) {
|
||||
static auto unwrap(expected_type&& e) {
|
||||
assert(e.is_value());
|
||||
return std::move(e.get_value());
|
||||
}
|
||||
};
|
||||
template <typename First, typename Second, typename... Rest>
|
||||
struct expected_result_trait<traits::identity<First, Second, Rest...>> {
|
||||
using expected = expected<std::tuple<First, Second, Rest...>>;
|
||||
using expected_type = expected<std::tuple<First, Second, Rest...>>;
|
||||
|
||||
static auto wrap(First first, Second second, Rest... rest) {
|
||||
return std::make_tuple(std::move(first), std::move(second),
|
||||
std::move(rest)...);
|
||||
}
|
||||
static auto unwrap(expected&& e) {
|
||||
static auto unwrap(expected_type&& e) {
|
||||
assert(e.is_value());
|
||||
return std::move(e.get_value());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user