MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / operator[]

Method operator[]

eval/public/builtin_func_test.cc:1160–1170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1158 int size() const override { return data_.size(); }
1159
1160 absl::optional<CelValue> operator[](CelValue key) const override {
1161 absl::optional<T> raw_value = get_cel_value_(key);
1162 if (!raw_value) {
1163 return absl::nullopt;
1164 }
1165 auto it = data_.find(*raw_value);
1166 if (it == data_.end()) {
1167 return absl::nullopt;
1168 }
1169 return it->second;
1170 }
1171
1172 absl::StatusOr<const CelList*> ListKeys() const override {
1173 return keys_.get();

Callers

nothing calls this directly

Calls 1

endMethod · 0.45

Tested by

no test coverage detected