For use with `RETURN_IF_ERROR(...).With(cel::ErrorValueAssign(&result))` and `ASSIGN_OR_RETURN(..., ..., _.With(cel::ErrorValueAssign(&result)))`. IMPORTANT: If the returning type is `absl::Status` the result will be `absl::OkStatus()`. If the returning type is `absl::StatusOr ` the result will be `T()`.
| 245 | // `absl::OkStatus()`. If the returning type is `absl::StatusOr<T>` the result |
| 246 | // will be `T()`. |
| 247 | class ErrorValueAssign final { |
| 248 | public: |
| 249 | ErrorValueAssign() = delete; |
| 250 | |
| 251 | explicit ErrorValueAssign(Value& value ABSL_ATTRIBUTE_LIFETIME_BOUND) |
| 252 | : ErrorValueAssign(std::addressof(value)) {} |
| 253 | |
| 254 | explicit ErrorValueAssign( |
| 255 | Value* absl_nonnull value ABSL_ATTRIBUTE_LIFETIME_BOUND) |
| 256 | : value_(value) { |
| 257 | ABSL_DCHECK(value != nullptr); |
| 258 | } |
| 259 | |
| 260 | common_internal::ImplicitlyConvertibleStatus operator()( |
| 261 | absl::Status status) const; |
| 262 | |
| 263 | private: |
| 264 | Value* absl_nonnull value_; |
| 265 | }; |
| 266 | |
| 267 | template <> |
| 268 | struct ArenaTraits<ErrorValue> { |