From 2d2bcd02acdcffd69121168925d4239c036235a7 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: May 01 2023 08:50:43 +0000 Subject: #assistants: fix TSmartPointerT --- diff --git a/toonz/sources/include/tsmartpointer.h b/toonz/sources/include/tsmartpointer.h index d965d20..613481f 100644 --- a/toonz/sources/include/tsmartpointer.h +++ b/toonz/sources/include/tsmartpointer.h @@ -147,17 +147,24 @@ public: bool operator>=(const T *p) const { return m_pointer >= p; } template - bool operator==(const TSmartHolderT &p) const { return p == m_pointer; } + bool equal(const TT *p) const { return m_pointer == p; } template - bool operator!=(const TSmartHolderT &p) const { return p != m_pointer; } + bool less(const TT *p) const { return m_pointer < p; } template - bool operator< (const TSmartHolderT &p) const { return p > m_pointer; } + bool greater(const TT *p) const { return m_pointer > p; } + + template + bool operator==(const TSmartHolderT &p) const { return p.equal(m_pointer); } + template + bool operator!=(const TSmartHolderT &p) const { return !p.equal(m_pointer); } + template + bool operator< (const TSmartHolderT &p) const { return p.greater(m_pointer); } template - bool operator> (const TSmartHolderT &p) const { return p < m_pointer; } + bool operator> (const TSmartHolderT &p) const { return p.less(m_pointer); } template - bool operator<=(const TSmartHolderT &p) const { return p >= m_pointer; } + bool operator<=(const TSmartHolderT &p) const { return !p.less(m_pointer); } template - bool operator>=(const TSmartHolderT &p) const { return p <= m_pointer; } + bool operator>=(const TSmartHolderT &p) const { return !p.greater(m_pointer); } }; //=========================================================