diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-29 10:58:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-29 11:00:08 +0200 |
commit | 88612f7170a2f0bb4a0215bdb6e615f9c7ff016d (patch) | |
tree | 37be1ae69918a5c3120660587a1cde039227f75e /include/vcl/vclptr.hxx | |
parent | 6bb742b9cbbdabbbd53dd9cdf6cb165e4b30bf86 (diff) |
Make MSVC happy?
Change-Id: I66b151aa726f6465f79003508520662e62b718aa
Diffstat (limited to 'include/vcl/vclptr.hxx')
-rw-r--r-- | include/vcl/vclptr.hxx | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 50c4c4300b97..ad7d1e20d9eb 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_PTR_HXX #include <rtl/ref.hxx> -#include <cstddef> #include <utility> #include <type_traits> @@ -211,27 +210,6 @@ public: } } - /** Returns True if handle points to the same body. - */ - template<class T> - inline bool operator== (const VclPtr<T> & handle) const - { - return (get() == handle.get()); - } - - /** Needed to place VclPtr's into STL collection. - */ - inline bool operator!= (const VclPtr<reference_type> & handle) const - { - return (m_rInnerRef != handle.m_rInnerRef); - } - - /** Makes comparing against NULL easier, resolves compile-time ambiguity */ - inline bool operator!= (::std::nullptr_t ) const - { - return (get() != nullptr); - } - /** Needed to place VclPtr's into STL collection. */ inline bool operator< (const VclPtr<reference_type> & handle) const @@ -247,6 +225,52 @@ public: } }; // class VclPtr +template<typename T1, typename T2> +inline bool operator ==(VclPtr<T1> const & p1, VclPtr<T2> const & p2) { + return p1.get() == p2.get(); +} + +template<typename T> inline bool operator ==(VclPtr<T> const & p1, T const * p2) +{ + return p1.get() == p2; +} + +template<typename T> inline bool operator ==(VclPtr<T> const & p1, T * p2) { + return p1.get() == p2; +} + +template<typename T> inline bool operator ==(T const * p1, VclPtr<T> const & p2) +{ + return p1 == p2.get(); +} + +template<typename T> inline bool operator ==(T * p1, VclPtr<T> const & p2) { + return p1 == p2.get(); +} + +template<typename T1, typename T2> +inline bool operator !=(VclPtr<T1> const & p1, VclPtr<T2> const & p2) { + return !(p1 == p2); +} + +template<typename T> inline bool operator !=(VclPtr<T> const & p1, T const * p2) +{ + return !(p1 == p2); +} + +template<typename T> inline bool operator !=(VclPtr<T> const & p1, T * p2) { + return !(p1 == p2); +} + +template<typename T> inline bool operator !=(T const * p1, VclPtr<T> const & p2) +{ + return !(p1 == p2); +} + +template<typename T> inline bool operator !=(T * p1, VclPtr<T> const & p2) { + return !(p1 == p2); +} + /** * A construction helper for a temporary VclPtr. Since VclPtr types * are created with a reference-count of one - to help fit into |