template <typename T, typename E, bool include_message>
struct OkOrFail
Defined at line 401 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
Public Methods
bool IsOk (const V & val)
Checks if V is ok or fail
Defined at line 413 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
T Unwrap (V && val)
Turns V into a success value
Defined at line 416 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
OkOrFail<V> Fail (V && v)
Consumes V when it's a fail value
Defined at line 426 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
Result<std::conditional_t<impl::IsNumeric<C>, impl::Never, C>, E, include_message> operator android::base::expected<std::conditional<impl::IsNumeric<__decay(decltype(std::declval<android::base::expected<type-parameter-0-0, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > >().error().code()))>, android::base::impl::Never, __decay(decltype(std::declval<android::base::expected<type-parameter-0-0, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > >().error().code()))>::type, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > ()
We specialize as much as possible to avoid ambiguous conversion with templated expected ctor.
We don't need this specialization if `C` is numeric because that case is already covered by
`NumericConversions`.
Defined at line 434 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
Result<std::conditional_t<impl::IsNumeric<C>, impl::Never, C>, E, include_message> operator android::base::expected<std::conditional<impl::IsNumeric<__decay(decltype(std::declval<android::base::expected<type-parameter-0-0, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > >().error().code()))>, android::base::impl::Never, __decay(decltype(std::declval<android::base::expected<type-parameter-0-0, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > >().error().code()))>::type, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > ()
Defined at line 438 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
template <Universal U>
Result<U, E, include_message> operator android::base::expected<type-parameter-1-0, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > ()
The idea here is to match this template method to any type (not simply trivial types).
The reason for including a constraint is to take advantage of the fact that a constrained
method always has strictly lower precedence than a non-constrained method in template
specialization rules (thus avoiding ambiguity). So we use a universally matching constraint to
mark this function as less preferable (but still accepting of all types).
Defined at line 449 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
template <Universal U>
Result<U, E, include_message> operator android::base::expected<type-parameter-1-0, android::base::ResultError<type-parameter-0-1, value-parameter-0-2> > ()
Defined at line 453 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h
const std::string & ErrorMessage (const V & val)
Defined at line 467 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h