Commit 4ee4b17
Allow
`std::abs()` doesn't work on custom types. While one can use the 3-argument version of `DistanceFrom()` to specify how to compute the distance, it's not as convenient as defining `abs()` for the custom type once in the type's namespace and then use the 2-argument version.
PiperOrigin-RevId: 735741409
Change-Id: If8fb668455eb963a2ccf089f7467c64965a2e7a6DistanceFrom() to use user-defined abs() by default.1 parent 0bdccf4 commit 4ee4b17
File tree
3 files changed
+42
-3
lines changed- docs/reference
- googlemock
- include/gmock
- test
3 files changed
+42
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3042 | 3042 | | |
3043 | 3043 | | |
3044 | 3044 | | |
3045 | | - | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
3046 | 3048 | | |
3047 | 3049 | | |
3048 | 3050 | | |
| |||
4470 | 4472 | | |
4471 | 4473 | | |
4472 | 4474 | | |
4473 | | - | |
| 4475 | + | |
4474 | 4476 | | |
4475 | 4477 | | |
4476 | 4478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
547 | 584 | | |
548 | 585 | | |
549 | 586 | | |
| |||
0 commit comments