-
#include "tensorstore/util/result.h"
-
template <typename Func>
FlatResult<std::invoke_result_t<Func&&, T&>>
tensorstore::Result<T>::operator|(Func&& func) const&; -
template <typename Func>
FlatResult<std::invoke_result_t<Func&&, T&&>>
tensorstore::Result<T>::operator|(Func&& func) &&; “Pipeline” operator for
Result
.In the expression
x | y
, ifThen
operator|
appliesy
to the value contained inx
, returning aResult<U>
. In other words, this function is roughly expressed as:return !x.ok() ? x.status() : Result<U>(y(x.value()))