aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-09-09 21:40:02 +0200
committerJay Berkenbilt <ejb@ql.org>2022-09-10 00:09:40 +0200
commit8a3cdfd2af4a95d8daede45bcb36eecdcdc8f964 (patch)
treeeca67c2673499f731138ded8b88b84afa83ef6aa /include
parent910a373a79f885cba1023fa69aa0c679e4ae0601 (diff)
downloadqpdf-8a3cdfd2af4a95d8daede45bcb36eecdcdc8f964.tar.zst
Change QPDFObjectHandle == to isSameObjectAs
Replace operator== and operator!=, which were testing for the same underlying object, with isSameObjectAs. This change was motivated by the fact that pikepdf internally had its own operator== method for QPDFObjectHandle that did structural comparison. I backed out qpdf's operator== as a courtesy to pikepdf (in my own testing) but also because I think people might naturally assume that operator== does a structural comparison, and isSameObjectAs is clearer in its intent.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFObjectHandle.hh13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index 21f82e58..66fd4a5a 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -334,14 +334,13 @@ class QPDFObjectHandle
QPDF_DLL
inline bool isInitialized() const;
- // Two QPDFObjectHandle objects are equal if they point to exactly
- // the same underlying object, meaning that changes to one are
- // reflected in the other, or "if you paint one, the other one
- // changes color."
+ // This method returns true if the QPDFObjectHandle objects point
+ // to exactly the same underlying object, meaning that changes to
+ // one are reflected in the other, or "if you paint one, the other
+ // one changes color." This does not perform a structural
+ // comparison of the contents of the objects.
QPDF_DLL
- bool operator==(QPDFObjectHandle const&) const;
- QPDF_DLL
- bool operator!=(QPDFObjectHandle const&) const;
+ bool isSameObjectAs(QPDFObjectHandle const&) const;
// Return type code and type name of underlying object. These are
// useful for doing rapid type tests (like switch statements) or