Commit c709dff
Use a single function,
See go/firestore-cpp-field-value-increment for more background and rationale.
This requires some template metaprogramming but results in a more convenient and safer API. In particular, `static_assert` allows preventing truncation with a readable error message (e.g. if a user passes `unsigned long long` as an argument).
While working on this, I discovered that STLPort actually does contain `<type_traits>` header, so the STLPort implementation is pretty straightforward (the only extra complication is accounting for the nested `tr1` namespace). I checked the code from this CL manually in Android Studio using STLPort on NDK r17, and it compiled successfully.
PiperOrigin-RevId: 308336176FieldValue::Increment, for both integer and double arguments.1 parent 7e51d56 commit c709dff
File tree
4 files changed
+103
-15
lines changed- app/meta
- firestore/src
- common
- include/firebase/firestore
- ios
4 files changed
+103
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
68 | 120 | | |
69 | 121 | | |
70 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
263 | 262 | | |
264 | | - | |
265 | 263 | | |
266 | | - | |
267 | 264 | | |
268 | 265 | | |
269 | 266 | | |
270 | 267 | | |
271 | | - | |
272 | 268 | | |
273 | 269 | | |
274 | 270 | | |
| |||
322 | 318 | | |
323 | 319 | | |
324 | 320 | | |
325 | | - | |
326 | | - | |
327 | 321 | | |
328 | | - | |
| 322 | + | |
329 | 323 | | |
330 | 324 | | |
331 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
| |||
315 | 328 | | |
316 | 329 | | |
317 | 330 | | |
318 | | - | |
| 331 | + | |
| 332 | + | |
319 | 333 | | |
320 | 334 | | |
321 | 335 | | |
| |||
325 | 339 | | |
326 | 340 | | |
327 | 341 | | |
328 | | - | |
| 342 | + | |
| 343 | + | |
329 | 344 | | |
330 | 345 | | |
331 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
332 | 358 | | |
333 | 359 | | |
334 | 360 | | |
335 | 361 | | |
336 | 362 | | |
337 | | - | |
| 363 | + | |
| 364 | + | |
338 | 365 | | |
339 | 366 | | |
340 | 367 | | |
| |||
344 | 371 | | |
345 | 372 | | |
346 | 373 | | |
347 | | - | |
| 374 | + | |
| 375 | + | |
348 | 376 | | |
349 | 377 | | |
350 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
351 | 391 | | |
352 | 392 | | |
353 | 393 | | |
| |||
380 | 420 | | |
381 | 421 | | |
382 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
383 | 426 | | |
384 | 427 | | |
385 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | 239 | | |
241 | | - | |
| 240 | + | |
242 | 241 | | |
243 | 242 | | |
244 | 243 | | |
| |||
0 commit comments