summaryrefslogtreecommitdiffstats
path: root/base/scoped_nsobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/scoped_nsobject.h')
-rw-r--r--base/scoped_nsobject.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/base/scoped_nsobject.h b/base/scoped_nsobject.h
index 7e544c9..bde2753 100644
--- a/base/scoped_nsobject.h
+++ b/base/scoped_nsobject.h
@@ -48,8 +48,13 @@ class scoped_nsobject {
object_ = object;
}
- bool operator==(NST* that) const { return object_ == that; }
- bool operator!=(NST* that) const { return object_ != that; }
+ bool operator==(NST* that) const {
+ return object_ == that;
+ }
+
+ bool operator!=(NST* that) const {
+ return object_ != that;
+ }
operator NST*() const {
return object_;
@@ -80,23 +85,6 @@ class scoped_nsobject {
DISALLOW_COPY_AND_ASSIGN(scoped_nsobject);
};
-// Free functions
-template <class C>
-void swap(scoped_nsobject<C>& p1, scoped_nsobject<C>& p2) {
- p1.swap(p2);
-}
-
-template <class C>
-bool operator==(C* p1, const scoped_nsobject<C>& p2) {
- return p1 == p2.get();
-}
-
-template <class C>
-bool operator!=(C* p1, const scoped_nsobject<C>& p2) {
- return p1 != p2.get();
-}
-
-
// Specialization to make scoped_nsobject<id> work.
template<>
class scoped_nsobject<id> {
@@ -121,8 +109,13 @@ class scoped_nsobject<id> {
object_ = object;
}
- bool operator==(id that) const { return object_ == that; }
- bool operator!=(id that) const { return object_ != that; }
+ bool operator==(id that) const {
+ return object_ == that;
+ }
+
+ bool operator!=(id that) const {
+ return object_ != that;
+ }
operator id() const {
return object_;