Index: base/mac/scoped_nsobject.h |
diff --git a/base/mac/scoped_nsobject.h b/base/mac/scoped_nsobject.h |
index 8d7bd4a27bd37c2844704e8beb2f0ef3bb849469..8814b51439b6f76e96e3e235bb620438009cdc50 100644 |
--- a/base/mac/scoped_nsobject.h |
+++ b/base/mac/scoped_nsobject.h |
@@ -40,6 +40,11 @@ class scoped_nsprotocol { |
: object_([that.object_ retain]) { |
} |
+ template <typename NSU> |
+ scoped_nsprotocol(const scoped_nsprotocol<NSU>& that) |
+ : object_([that.get() retain]) { |
+ } |
+ |
~scoped_nsprotocol() { |
[object_ release]; |
} |
@@ -119,6 +124,11 @@ class scoped_nsobject : public scoped_nsprotocol<NST*> { |
: scoped_nsprotocol<NST*>(that) { |
} |
+ template<typename NSU> |
+ scoped_nsobject(const scoped_nsobject<NSU>& that) |
+ : scoped_nsprotocol<NST*>(that) { |
+ } |
+ |
scoped_nsobject& operator=(const scoped_nsobject<NST>& that) { |
scoped_nsprotocol<NST*>::operator=(that); |
return *this; |
@@ -135,6 +145,11 @@ class scoped_nsobject<id> : public scoped_nsprotocol<id> { |
: scoped_nsprotocol<id>(that) { |
} |
+ template<typename NSU> |
+ scoped_nsobject(const scoped_nsobject<NSU>& that) |
+ : scoped_nsprotocol<id>(that) { |
+ } |
+ |
scoped_nsobject& operator=(const scoped_nsobject<id>& that) { |
scoped_nsprotocol<id>::operator=(that); |
return *this; |