MCPcopy Create free account
hub / github.com/apache/arrow / AddWithOverflow

Function AddWithOverflow

cpp/src/arrow/util/int_util_overflow.h:189–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187// Convenience functions over an arbitrary number of arguments
188template <typename Int>
189std::optional<Int> AddWithOverflow(std::initializer_list<Int> vs) {
190 if (vs.size() == 0) {
191 return {};
192 }
193 auto it = vs.begin();
194 Int v = *it++;
195 while (it != vs.end()) {
196 if (ARROW_PREDICT_FALSE(AddWithOverflowGeneric(v, *it++, &v))) {
197 return {};
198 }
199 }
200 return v;
201}
202
203template <typename Int>
204std::optional<Int> MultiplyWithOverflow(std::initializer_list<Int> vs) {

Callers 15

FieldMethod · 0.85
ComputeTensorSizeFunction · 0.85
RawSizeMethod · 0.85
AppendTimestampBatchFunction · 0.85
ConcatenateBitmapsFunction · 0.85
VisitMethod · 0.85
ValidateLayoutMethod · 0.85
CloseRunMethod · 0.85
ReadBufferMethod · 0.85
CheckOkMethod · 0.85

Calls 4

AddWithOverflowGenericFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 3

CheckOkMethod · 0.68
CheckOverflowMethod · 0.68
TESTFunction · 0.68