Commit 722ca8e0839a21f9210903cfa66c062beddb279c
1 parent
3a2e6764
Add `operator==` to `BaseHandle` for object equality comparison
Showing
2 changed files
with
7 additions
and
1 deletions
include/qpdf/ObjectHandle.hh
| ... | ... | @@ -61,6 +61,13 @@ namespace qpdf |
| 61 | 61 | |
| 62 | 62 | // The rest of the header file is for qpdf internal use only. |
| 63 | 63 | |
| 64 | + // Return true if both object handles refer to the same underlying object. | |
| 65 | + bool | |
| 66 | + operator==(BaseHandle const& other) const | |
| 67 | + { | |
| 68 | + return obj == other.obj; | |
| 69 | + } | |
| 70 | + | |
| 64 | 71 | // For arrays, return the number of items in the array. |
| 65 | 72 | // For null-like objects, return 0. |
| 66 | 73 | // For all other objects, return 1. | ... | ... |
libqpdf/QPDF_Array.cc