MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / ErrorValueAssign

Class ErrorValueAssign

common/values/error_value.h:247–265  ·  view source on GitHub ↗

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()`.

Source from the content-addressed store, hash-verified

245// `absl::OkStatus()`. If the returning type is `absl::StatusOr<T>` the result
246// will be `T()`.
247class 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
267template <>
268struct ArenaTraits<ErrorValue> {

Callers 1

EvaluateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected