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

Function AddWithOverflow

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

Source from the content-addressed store, hash-verified

167// Convenience functions over an arbitrary number of arguments
168template <typename Int>
169std::optional<Int> AddWithOverflow(std::initializer_list<Int> vs) {
170 if (vs.size() == 0) {
171 return {};
172 }
173 auto it = vs.begin();
174 Int v = *it++;
175 while (it != vs.end()) {
176 if (ARROW_PREDICT_FALSE(AddWithOverflowGeneric(v, *it++, &v))) {
177 return {};
178 }
179 }
180 return v;
181}
182
183template <typename Int>
184std::optional<Int> MultiplyWithOverflow(std::initializer_list<Int> vs) {

Callers 15

FieldMethod · 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
CheckOverflowMethod · 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