aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-02-26 13:54:21 +0000
committerJohannes Schickel2009-02-26 13:54:21 +0000
commit868b589af62d8afec68265651d807c183c4659bf (patch)
tree52a560884a26dc855d392023bc7a77d1d694f0b8
parent1377a4b64cdeba148ba23bd10c8623a2d0a5fc8d (diff)
downloadscummvm-rg350-868b589af62d8afec68265651d807c183c4659bf.tar.gz
scummvm-rg350-868b589af62d8afec68265651d807c183c4659bf.tar.bz2
scummvm-rg350-868b589af62d8afec68265651d807c183c4659bf.zip
Commit patch #2641592 "Wrong type promotion for SharedPtr" with a slight formatting change.
svn-id: r38901
-rw-r--r--common/ptr.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/common/ptr.h b/common/ptr.h
index 21656ad32a..4d0f70ced1 100644
--- a/common/ptr.h
+++ b/common/ptr.h
@@ -180,6 +180,16 @@ public:
_pointer = 0;
}
+ template<class T2>
+ bool operator==(const Common::SharedPtr<T2> &r) const {
+ return _pointer == r.get();
+ }
+
+ template<class T2>
+ bool operator!=(const Common::SharedPtr<T2> &r) const {
+ return _pointer != r.get();
+ }
+
/**
* Returns the number of references to the assigned pointer.
* This should just be used for debugging purposes.
@@ -208,14 +218,4 @@ private:
} // end of namespace Common
-template<class T1, class T2>
-bool operator==(const Common::SharedPtr<T1> &l, const Common::SharedPtr<T2> &r) {
- return l.get() == r.get();
-}
-
-template<class T1, class T2>
-bool operator!=(const Common::SharedPtr<T1> &l, const Common::SharedPtr<T2> &r) {
- return l.get() != r.get();
-}
-
#endif