forked from boostorg/smart_ptr
Comparison operators against a raw pointer now accept different types
[SVN r31110]
This commit is contained in:
@ -174,22 +174,22 @@ template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, in
|
||||
return a.get() != b.get();
|
||||
}
|
||||
|
||||
template<class T> inline bool operator==(intrusive_ptr<T> const & a, T * b)
|
||||
template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b)
|
||||
{
|
||||
return a.get() == b;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=(intrusive_ptr<T> const & a, T * b)
|
||||
template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b)
|
||||
{
|
||||
return a.get() != b;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator==(T * a, intrusive_ptr<T> const & b)
|
||||
template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b)
|
||||
{
|
||||
return a == b.get();
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=(T * a, intrusive_ptr<T> const & b)
|
||||
template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b)
|
||||
{
|
||||
return a != b.get();
|
||||
}
|
||||
|
@ -5,8 +5,8 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
<body text="#000000" bgColor="#ffffff">
|
||||
<h1><IMG height="86" alt="boost.png (6897 bytes)" src="../../boost.png" width="277" align="middle">intrusive_ptr
|
||||
class template</h1>
|
||||
<h1><A href="../.."><IMG height="86" alt="boost.png (6897 bytes)" src="../../boost.png" width="277" align="middle"
|
||||
border="0"></A>intrusive_ptr class template</h1>
|
||||
<p>
|
||||
<A href="#Introduction">Introduction</A><br>
|
||||
<A href="#Synopsis">Synopsis</A><br>
|
||||
@ -31,11 +31,11 @@
|
||||
<P>The main reasons to use <STRONG>intrusive_ptr</STRONG> are:</P>
|
||||
<UL>
|
||||
<LI>
|
||||
Some existing frameworks or OSes provide objects with embedded reference
|
||||
counts;</LI>
|
||||
Some existing frameworks or OSes provide objects with embedded reference
|
||||
counts;
|
||||
<LI>
|
||||
The memory footprint of <STRONG>intrusive_ptr</STRONG> is the same as the
|
||||
corresponding raw pointer;</LI>
|
||||
The memory footprint of <STRONG>intrusive_ptr</STRONG>
|
||||
is the same as the corresponding raw pointer;
|
||||
<LI>
|
||||
<STRONG>intrusive_ptr<T></STRONG> can be constructed from an arbitrary
|
||||
raw pointer of type <STRONG>T *</STRONG>.</LI></UL>
|
||||
@ -196,26 +196,26 @@ intrusive_ptr & operator=(T * r);</pre>
|
||||
<p><b>Returns:</b> <code>a.get() != b.get()</code>.</p>
|
||||
<p><b>Throws:</b> nothing.</p>
|
||||
</blockquote>
|
||||
<pre>template<class T>
|
||||
bool operator==(intrusive_ptr<T> const & a, T * b); // never throws</pre>
|
||||
<pre>template<class T, class U>
|
||||
bool operator==(intrusive_ptr<T> const & a, U * b); // never throws</pre>
|
||||
<blockquote>
|
||||
<p><b>Returns:</b> <code>a.get() == b</code>.</p>
|
||||
<p><b>Throws:</b> nothing.</p>
|
||||
</blockquote>
|
||||
<pre>template<class T>
|
||||
bool operator!=(intrusive_ptr<T> const & a, T * b); // never throws</pre>
|
||||
<pre>template<class T, class U>
|
||||
bool operator!=(intrusive_ptr<T> const & a, U * b); // never throws</pre>
|
||||
<blockquote>
|
||||
<p><b>Returns:</b> <code>a.get() != b</code>.</p>
|
||||
<p><b>Throws:</b> nothing.</p>
|
||||
</blockquote>
|
||||
<pre>template<class T>
|
||||
bool operator==(T * a, intrusive_ptr<T> const & b); // never throws</pre>
|
||||
<pre>template<class T, class U>
|
||||
bool operator==(T * a, intrusive_ptr<U> const & b); // never throws</pre>
|
||||
<blockquote>
|
||||
<p><b>Returns:</b> <code>a == b.get()</code>.</p>
|
||||
<p><b>Throws:</b> nothing.</p>
|
||||
</blockquote>
|
||||
<pre>template<class T>
|
||||
bool operator!=(T * a, intrusive_ptr<T> const & b); // never throws</pre>
|
||||
<pre>template<class T, class U>
|
||||
bool operator!=(T * a, intrusive_ptr<U> const & b); // never throws</pre>
|
||||
<blockquote>
|
||||
<p><b>Returns:</b> <code>a != b.get()</code>.</p>
|
||||
<p><b>Throws:</b> nothing.</p>
|
||||
@ -278,9 +278,9 @@ intrusive_ptr & operator=(T * r);</pre>
|
||||
<p>
|
||||
$Date$</p>
|
||||
<p>
|
||||
<small>Copyright <20> 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.</small></p>
|
||||
<small>Copyright <20> 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.</small></p>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user