Remove dangling conversion to optional<T> & (#93385)

This commit is contained in:
David Stone 2024-05-31 11:23:14 -06:00 committed by GitHub
parent 3b79c823f6
commit 41ddf128ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,14 +97,6 @@ public:
template <typename U> T value_or(U &&alt) && {
return has_value() ? std::move(operator*()) : std::forward<U>(alt);
}
// Allow conversion to std::optional<T>.
explicit operator std::optional<T> &() const & {
return *this ? **this : std::optional<T>();
}
explicit operator std::optional<T> &&() const && {
return *this ? std::move(**this) : std::optional<T>();
}
};
template <typename T>