From: Vadim Zeitlin Date: Mon, 21 Jul 2003 13:03:33 +0000 (+0000) Subject: only define operator bool() if operator long() is not defined X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c89d41600b3fd4e61893cf69bec4e44f14b5f9e3 only define operator bool() if operator long() is not defined git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/treebase.h b/include/wx/treebase.h index d4fb2c3d08..b74c64b520 100644 --- a/include/wx/treebase.h +++ b/include/wx/treebase.h @@ -52,6 +52,8 @@ public: // accessors // is this a valid tree item? bool IsOk() const { return m_pItem != 0; } + // return true if this item is not valid + bool operator!() const { return !IsOk(); } // operations // invalidate the item @@ -61,12 +63,11 @@ public: // deprecated: only for compatibility, don't work on 64 bit archs wxTreeItemId(long item) { m_pItem = (wxTreeItemIdValue)item; } operator long() const { return (long)m_pItem; } -#endif // WXWIN_COMPATIBILITY_2_4 - - wxTreeItemIdValue m_pItem; - bool operator!() const { return !IsOk(); } +#else // !WXWIN_COMPATIBILITY_2_4 operator bool() const { return IsOk(); } +#endif // WXWIN_COMPATIBILITY_2_4/!WXWIN_COMPATIBILITY_2_4 + wxTreeItemIdValue m_pItem; }; inline bool operator==(const wxTreeItemId& i1, const wxTreeItemId& i2)