forked from boostorg/smart_ptr
operator< documenation fix.
[SVN r30166]
This commit is contained in:
@@ -50,8 +50,8 @@
|
|||||||
<P><STRONG>shared_ptr</STRONG> is now part of <STRONG>TR1</STRONG>, the first C++
|
<P><STRONG>shared_ptr</STRONG> is now part of <STRONG>TR1</STRONG>, the first C++
|
||||||
Library Technical Report. The latest draft of <STRONG>TR1</STRONG> is available
|
Library Technical Report. The latest draft of <STRONG>TR1</STRONG> is available
|
||||||
at the following location:</P>
|
at the following location:</P>
|
||||||
<P><A href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1745.pdf">http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1745.pdf</A> (1.36Mb
|
<P><A href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1745.pdf">http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1745.pdf</A>
|
||||||
PDF)</P>
|
(1.36Mb PDF)</P>
|
||||||
<P>This implementation conforms to the TR1 specification, with the only exception
|
<P>This implementation conforms to the TR1 specification, with the only exception
|
||||||
that it resides in namespace <code>boost</code> instead of <code>std::tr1</code>.</P>
|
that it resides in namespace <code>boost</code> instead of <code>std::tr1</code>.</P>
|
||||||
<h2><a name="BestPractices">Best Practices</a></h2>
|
<h2><a name="BestPractices">Best Practices</a></h2>
|
||||||
@@ -402,7 +402,7 @@ q = p;
|
|||||||
<LI>
|
<LI>
|
||||||
under the equivalence relation defined by <STRONG>operator<</STRONG>, <code>!(a
|
under the equivalence relation defined by <STRONG>operator<</STRONG>, <code>!(a
|
||||||
< b) && !(b < a)</code>, two <STRONG>shared_ptr</STRONG> instances
|
< b) && !(b < a)</code>, two <STRONG>shared_ptr</STRONG> instances
|
||||||
are equivalent if and only if they <EM>share ownership</EM>.</LI></UL>
|
are equivalent if and only if they <EM>share ownership</EM> or are both <EM>empty</EM>.</LI></UL>
|
||||||
<p><b>Throws:</b> nothing.</p>
|
<p><b>Throws:</b> nothing.</p>
|
||||||
<P><B>Notes:</B> Allows <STRONG>shared_ptr</STRONG> objects to be used as keys in
|
<P><B>Notes:</B> Allows <STRONG>shared_ptr</STRONG> objects to be used as keys in
|
||||||
associative containers.</P>
|
associative containers.</P>
|
||||||
@@ -582,27 +582,27 @@ p3.reset(new int(2)); // undefined, multiple writes
|
|||||||
implementation on the following platforms:</P>
|
implementation on the following platforms:</P>
|
||||||
<UL>
|
<UL>
|
||||||
<LI>
|
<LI>
|
||||||
GNU GCC on x86 or x86-64;</LI>
|
GNU GCC on x86 or x86-64;
|
||||||
<LI>
|
<LI>
|
||||||
GNU GCC on IA64;</LI>
|
GNU GCC on IA64;
|
||||||
<LI>
|
<LI>
|
||||||
Metrowerks CodeWarrior on PowerPC;</LI>
|
Metrowerks CodeWarrior on PowerPC;
|
||||||
<LI>
|
<LI>
|
||||||
GNU GCC on PowerPC;</LI>
|
GNU GCC on PowerPC;
|
||||||
<LI>
|
<LI>
|
||||||
Windows.</LI></UL>
|
Windows.</LI></UL>
|
||||||
<P>If your program is single-threaded and does not link to any libraries that might
|
<P>If your program is single-threaded and does not link to any libraries that might
|
||||||
have used <STRONG>shared_ptr</STRONG> in its default configuration, you can <STRONG>
|
have used <STRONG>shared_ptr</STRONG> in its default configuration, you can <STRONG>
|
||||||
#define</STRONG> the macro <STRONG>BOOST_SP_DISABLE_THREADS</STRONG> on a
|
#define</STRONG> the macro <STRONG>BOOST_SP_DISABLE_THREADS</STRONG> on a
|
||||||
project-wide basis to switch to ordinary non-atomic reference count updates.</P>
|
project-wide basis to switch to ordinary non-atomic reference count updates.</P>
|
||||||
<P>(Defining <STRONG>BOOST_SP_DISABLE_THREADS</STRONG> in some, but not
|
<P>(Defining <STRONG>BOOST_SP_DISABLE_THREADS</STRONG> in some, but not all,
|
||||||
all, translation units is technically a violation of the One Definition
|
translation units is technically a violation of the One Definition Rule and
|
||||||
Rule and undefined behavior. Nevertheless, the implementation attempts to do
|
undefined behavior. Nevertheless, the implementation attempts to do its best to
|
||||||
its best to accommodate the request to use non-atomic updates in those
|
accommodate the request to use non-atomic updates in those translation units.
|
||||||
translation units. No guarantees, though.)</P>
|
No guarantees, though.)</P>
|
||||||
<P>You can define the macro <STRONG>BOOST_SP_USE_PTHREADS</STRONG> to turn off the
|
<P>You can define the macro <STRONG>BOOST_SP_USE_PTHREADS</STRONG> to turn off the
|
||||||
lock-free platform-specific implementation and fall back to the generic <STRONG>
|
lock-free platform-specific implementation and fall back to the generic <STRONG>pthread_mutex_t</STRONG>-based
|
||||||
pthread_mutex_t</STRONG>-based code.</P>
|
code.</P>
|
||||||
<h2><a name="FAQ">Frequently Asked Questions</a></h2>
|
<h2><a name="FAQ">Frequently Asked Questions</a></h2>
|
||||||
<P><B>Q.</B> There are several variations of shared pointers, with different
|
<P><B>Q.</B> There are several variations of shared pointers, with different
|
||||||
tradeoffs; why does the smart pointer library supply only a single
|
tradeoffs; why does the smart pointer library supply only a single
|
||||||
|
@@ -145,9 +145,8 @@ template<class Y> weak_ptr & operator=(shared_ptr<Y> const &
|
|||||||
<h3><a name="use_count">use_count</a></h3>
|
<h3><a name="use_count">use_count</a></h3>
|
||||||
<pre>long use_count() const;</pre>
|
<pre>long use_count() const;</pre>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><b>Returns:</b> 0 if <STRONG>*this</STRONG> is <EM>empty</EM>; otherwise,
|
<p><b>Returns:</b> 0 if <STRONG>*this</STRONG> is <EM>empty</EM>; otherwise, the
|
||||||
the number of <b>shared_ptr</b> objects that <EM>share ownership</EM>
|
number of <b>shared_ptr</b> objects that <EM>share ownership</EM> with <STRONG>*this</STRONG>.</p>
|
||||||
with <STRONG>*this</STRONG>.</p>
|
|
||||||
<p><b>Throws:</b> nothing.</p>
|
<p><b>Throws:</b> nothing.</p>
|
||||||
<P><B>Notes:</B> <code>use_count()</code> is not necessarily efficient. Use only
|
<P><B>Notes:</B> <code>use_count()</code> is not necessarily efficient. Use only
|
||||||
for debugging and testing purposes, not for production code.</P>
|
for debugging and testing purposes, not for production code.</P>
|
||||||
@@ -189,7 +188,7 @@ template<class Y> weak_ptr & operator=(shared_ptr<Y> const &
|
|||||||
<LI>
|
<LI>
|
||||||
under the equivalence relation defined by <STRONG>operator<</STRONG>, <code>!(a
|
under the equivalence relation defined by <STRONG>operator<</STRONG>, <code>!(a
|
||||||
< b) && !(b < a)</code>, two <STRONG>weak_ptr</STRONG> instances
|
< b) && !(b < a)</code>, two <STRONG>weak_ptr</STRONG> instances
|
||||||
are equivalent if and only if they <EM>share ownership</EM>.</LI></UL>
|
are equivalent if and only if they <EM>share ownership</EM> or are both <EM>empty</EM>.</LI></UL>
|
||||||
<p><b>Throws:</b> nothing.</p>
|
<p><b>Throws:</b> nothing.</p>
|
||||||
<P><B>Notes:</B> Allows <STRONG>weak_ptr</STRONG> objects to be used as keys in
|
<P><B>Notes:</B> Allows <STRONG>weak_ptr</STRONG> objects to be used as keys in
|
||||||
associative containers.</P>
|
associative containers.</P>
|
||||||
|
Reference in New Issue
Block a user