Index: base/memory/scoped_ptr.h |
diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h |
index 5edde8fb32e655f0516f19733c1a8b86c86a59dc..dfa12587242962f5884d1f6246aeeca068d16756 100644 |
--- a/base/memory/scoped_ptr.h |
+++ b/base/memory/scoped_ptr.h |
@@ -384,6 +384,11 @@ class scoped_ptr { |
// Allow scoped_ptr<element_type> to be used in boolean expressions, but not |
// implicitly convertible to a real bool (which is dangerous). |
+ // |
+ // Note that this trick is only safe when the == and != operators |
+ // are declared explicitly, as otherwise "scoped_ptr1 == |
+ // scoped_ptr2" will compile but do the wrong thing (i.e., convert |
+ // to Testable and then do the comparison). |
private: |
typedef base::internal::scoped_ptr_impl<element_type, deleter_type> |
scoped_ptr::*Testable; |