aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-10 13:15:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-10 13:15:33 +0200
commit1cb53f9850ed593d75b6e3af0454616b30048643 (patch)
treebe49fa584e0fc7cc64fafd0840b0fcbe794ae61f
parente3b8e723b1bd642d7ed19d49437a2e59d80a249e (diff)
Add comparison operators for shared_ptr
-rw-r--r--cutl/shared-ptr.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/cutl/shared-ptr.hxx b/cutl/shared-ptr.hxx
index de85447..702af29 100644
--- a/cutl/shared-ptr.hxx
+++ b/cutl/shared-ptr.hxx
@@ -140,6 +140,20 @@ namespace cutl
X* x_;
};
+
+ template <typename X, typename Y>
+ inline bool
+ operator== (const shared_ptr<X>& x, const shared_ptr<Y>& y)
+ {
+ return x.get () == y.get ();
+ }
+
+ template <typename X, typename Y>
+ inline bool
+ operator!= (const shared_ptr<X>& x, const shared_ptr<Y>& y)
+ {
+ return x.get () != y.get ();
+ }
}
#endif // CUTL_SHARED_PTR_HXX