From 7bfddbccf6c0dff239ff52b70c740b9f4027ced1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 25 Sep 2005 21:27:00 +0000 Subject: [PATCH] Comparison operators against a raw pointer now accept different types [SVN r31110] --- include/boost/intrusive_ptr.hpp | 8 ++++---- intrusive_ptr.html | 36 ++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/boost/intrusive_ptr.hpp b/include/boost/intrusive_ptr.hpp index dd8cc39..b03b901 100644 --- a/include/boost/intrusive_ptr.hpp +++ b/include/boost/intrusive_ptr.hpp @@ -174,22 +174,22 @@ template inline bool operator!=(intrusive_ptr const & a, in return a.get() != b.get(); } -template inline bool operator==(intrusive_ptr const & a, T * b) +template inline bool operator==(intrusive_ptr const & a, U * b) { return a.get() == b; } -template inline bool operator!=(intrusive_ptr const & a, T * b) +template inline bool operator!=(intrusive_ptr const & a, U * b) { return a.get() != b; } -template inline bool operator==(T * a, intrusive_ptr const & b) +template inline bool operator==(T * a, intrusive_ptr const & b) { return a == b.get(); } -template inline bool operator!=(T * a, intrusive_ptr const & b) +template inline bool operator!=(T * a, intrusive_ptr const & b) { return a != b.get(); } diff --git a/intrusive_ptr.html b/intrusive_ptr.html index c0ddfeb..8844491 100644 --- a/intrusive_ptr.html +++ b/intrusive_ptr.html @@ -5,8 +5,8 @@ -

boost.png (6897 bytes)intrusive_ptr - class template

+

boost.png (6897 bytes)intrusive_ptr class template

Introduction
Synopsis
@@ -31,11 +31,11 @@

The main reasons to use intrusive_ptr are:

  • - Some existing frameworks or OSes provide objects with embedded reference - counts;
  • + Some existing frameworks or OSes provide objects with embedded reference + counts;
  • - The memory footprint of intrusive_ptr is the same as the - corresponding raw pointer;
  • + The memory footprint of intrusive_ptr + is the same as the corresponding raw pointer;
  • intrusive_ptr<T> can be constructed from an arbitrary raw pointer of type T *.
@@ -196,26 +196,26 @@ intrusive_ptr & operator=(T * r);

Returns: a.get() != b.get().

Throws: nothing.

-
template<class T>
-  bool operator==(intrusive_ptr<T> const & a, T * b); // never throws
+
template<class T, class U>
+  bool operator==(intrusive_ptr<T> const & a, U * b); // never throws

Returns: a.get() == b.

Throws: nothing.

-
template<class T>
-  bool operator!=(intrusive_ptr<T> const & a, T * b); // never throws
+
template<class T, class U>
+  bool operator!=(intrusive_ptr<T> const & a, U * b); // never throws

Returns: a.get() != b.

Throws: nothing.

-
template<class T>
-  bool operator==(T * a, intrusive_ptr<T> const & b); // never throws
+
template<class T, class U>
+  bool operator==(T * a, intrusive_ptr<U> const & b); // never throws

Returns: a == b.get().

Throws: nothing.

-
template<class T>
-  bool operator!=(T * a, intrusive_ptr<T> const & b); // never throws
+
template<class T, class U>
+  bool operator!=(T * a, intrusive_ptr<U> const & b); // never throws

Returns: a != b.get().

Throws: nothing.

@@ -278,9 +278,9 @@ intrusive_ptr & operator=(T * r);

$Date$

- Copyright © 2003 Peter Dimov. Permission to copy, use, modify, sell and - distribute this document is granted provided this copyright notice appears in - all copies. This document is provided "as is" without express or implied - warranty, and with no claim as to its suitability for any purpose.

+ Copyright © 2003-2005 Peter Dimov. Permission to copy, use, modify, sell and + distribute this document is granted provided this copyright notice appears in + all copies. This document is provided "as is" without express or implied + warranty, and with no claim as to its suitability for any purpose.