Open
Description
Consider this: https://godbolt.org/z/qK4GTrdYM
The decay
function is only needed there, because try_at
returns result<value const&>
, and the righthand operand of operator|
is not convertible to value const&
.
Given that operator|
is used for providing a default, and the default usually doesn't exist before it is required, most of the time you don't want to return a result<T&>
, even if the source is a result<T&>
.
I can suggest adding result<T> operator|(result<T&>, U)
overload that matches if U
is convertible to std::decay_t<T&>
. Same for function overloads.
Metadata
Metadata
Assignees
Labels
No labels