mirror of
https://github.com/TartanLlama/optional.git
synced 2025-07-29 17:37:13 +02:00
fixed build
This commit is contained in:
@ -741,8 +741,7 @@ public:
|
|||||||
static_assert(detail::is_optional<result>::value,
|
static_assert(detail::is_optional<result>::value,
|
||||||
"F must return an optional");
|
"F must return an optional");
|
||||||
|
|
||||||
return has_value() ? detail::invoke(std::forward<F>(f), **this)
|
return has_value() ? detail::invoke(std::forward<F>(f), **this) : result(nullopt);
|
||||||
: result(nullopt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class F>
|
template <class F>
|
||||||
@ -1582,7 +1581,7 @@ public:
|
|||||||
static_assert(detail::is_optional<result>::value,
|
static_assert(detail::is_optional<result>::value,
|
||||||
"F must return an optional");
|
"F must return an optional");
|
||||||
|
|
||||||
return has_value() ? detail::invoke(std::forward<F>(f), std::move(**this))
|
return has_value() ? detail::invoke(std::forward<F>(f), **this)
|
||||||
: result(nullopt);
|
: result(nullopt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1601,7 +1600,7 @@ public:
|
|||||||
static_assert(detail::is_optional<result>::value,
|
static_assert(detail::is_optional<result>::value,
|
||||||
"F must return an optional");
|
"F must return an optional");
|
||||||
|
|
||||||
return has_value() ? detail::invoke(std::forward<F>(f), std::move(**this))
|
return has_value() ? detail::invoke(std::forward<F>(f), **this)
|
||||||
: result(nullopt);
|
: result(nullopt);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1624,7 +1623,7 @@ public:
|
|||||||
static_assert(detail::is_optional<result>::value,
|
static_assert(detail::is_optional<result>::value,
|
||||||
"F must return an optional");
|
"F must return an optional");
|
||||||
|
|
||||||
return has_value() ? detail::invoke(std::forward<F>(f), std::move(**this))
|
return has_value() ? detail::invoke(std::forward<F>(f), **this)
|
||||||
: result(nullopt);
|
: result(nullopt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2033,7 +2032,7 @@ public:
|
|||||||
static_assert(std::is_move_constructible<T>::value &&
|
static_assert(std::is_move_constructible<T>::value &&
|
||||||
std::is_convertible<U &&, T>::value,
|
std::is_convertible<U &&, T>::value,
|
||||||
"T must be move constructible and convertible from U");
|
"T must be move constructible and convertible from U");
|
||||||
return has_value() ? std::move(**this) : static_cast<T>(std::forward<U>(u));
|
return has_value() ? **this : static_cast<T>(std::forward<U>(u));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroys the stored value if one exists, making the optional empty
|
/// Destroys the stored value if one exists, making the optional empty
|
||||||
|
Reference in New Issue
Block a user