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

Class LosslessConvertibleToIntVisitor

internal/number.h:184–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182};
183
184struct LosslessConvertibleToIntVisitor {
185 constexpr bool operator()(double value) const {
186 return value >= kDoubleToIntMin && value <= kMaxDoubleRepresentableAsInt &&
187 value == static_cast<double>(static_cast<int64_t>(value));
188 }
189 constexpr bool operator()(uint64_t value) const {
190 return value <= kUintToIntMax;
191 }
192 constexpr bool operator()(int64_t value) const { return true; }
193};
194
195struct LosslessConvertibleToUintVisitor {
196 constexpr bool operator()(double value) const {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected