mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 12:16:49 +00:00
Remove dangling conversion to optional<T> &
(#93385)
This commit is contained in:
parent
3b79c823f6
commit
41ddf128ea
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user