diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-10 13:15:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-10 13:15:33 +0200 |
commit | 1cb53f9850ed593d75b6e3af0454616b30048643 (patch) | |
tree | be49fa584e0fc7cc64fafd0840b0fcbe794ae61f /cutl/shared-ptr.hxx | |
parent | e3b8e723b1bd642d7ed19d49437a2e59d80a249e (diff) |
Add comparison operators for shared_ptr
Diffstat (limited to 'cutl/shared-ptr.hxx')
-rw-r--r-- | cutl/shared-ptr.hxx | 14 |
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 |