Fixed broken links.

[SVN r17044]
This commit is contained in:
Peter Dimov
2003-01-25 17:58:01 +00:00
parent 2dbfc89d4e
commit b60de38d28
5 changed files with 96 additions and 97 deletions

View File

@ -1,15 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head>
<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Boost Smart Pointer Library</title>
<title>Boost Smart Pointer Library</title> </head>
</head> <body bgcolor="#FFFFFF" text="#000000">
<table border="1" bgcolor="#007F7F" cellpadding="2">
<body bgcolor="#FFFFFF" text="#000000">
<table border="1" bgcolor="#007F7F" cellpadding="2">
<tr> <tr>
<td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td> <td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td>
<td><a href="../../index.htm"><font face="Arial" color="#FFFFFF"><big>Home</big></font></a></td> <td><a href="../../index.htm"><font face="Arial" color="#FFFFFF"><big>Home</big></font></a></td>
@ -18,30 +14,34 @@
<td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ</big></font></a></td> <td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ</big></font></a></td>
<td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More</big></font></a></td> <td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More</big></font></a></td>
</tr> </tr>
</table> </table>
<h1>Smart Pointer Library</h1> <h1>Smart Pointer Library</h1>
<p>The smart pointer library includes five smart pointer class templates. Smart <p>The smart pointer library includes five smart pointer class templates. Smart
pointers ease the management of memory dynamically allocated with C++ <b>new</b> pointers ease the management of memory dynamically allocated with C++ <b>new</b>
expressions. In addition, <b>scoped_ptr</b> can ease the management of memory expressions. In addition, <b>scoped_ptr</b> can ease the management of memory
dynamically allocated in other ways.</p> dynamically allocated in other ways.</p>
<ul> <ul>
<li><a href="smart_ptr.htm">Documentation</a> (HTML).</li> <li>
<li>Header <a href="../../boost/scoped_ptr.hpp">scoped_ptr.hpp</a>.</li> <a href="smart_ptr.htm">Documentation</a> (HTML).</li>
<li>Header <a href="../../boost/scoped_array.hpp">scoped_array.hpp</a>.</li> <li>
<li>Header <a href="../../boost/shared_ptr.hpp">shared_ptr.hpp</a>.</li> Header <a href="../../boost/scoped_ptr.hpp">scoped_ptr.hpp</a>.</li>
<li>Header <a href="../../boost/shared_array.hpp">shared_array.hpp</a>.</li> <li>
<li>Header <a href="../../boost/weak_ptr.hpp">weak_ptr.hpp</a>.</li> Header <a href="../../boost/scoped_array.hpp">scoped_array.hpp</a>.</li>
<li>Test program <a href="smart_ptr_test.cpp">smart_ptr_test.cpp</a>.</li> <li>
<li>Originally submitted by Header <a href="../../boost/shared_ptr.hpp">shared_ptr.hpp</a>.</li>
<a href="../../people/greg_colvin.htm">Greg Colvin</a> and <li>
<a href="../../people/beman_dawes.html">Beman Dawes</a>, Header <a href="../../boost/shared_array.hpp">shared_array.hpp</a>.</li>
currently maintained by <li>
<a href="../../people/peter_dimov.htm">Peter Dimov</a> and Header <a href="../../boost/weak_ptr.hpp">weak_ptr.hpp</a>.</li>
<a href="../../people/darin_adler.htm">Darin Adler</a>.</li> <li>
</ul> Test program <a href="test/smart_ptr_test.cpp">smart_ptr_test.cpp</a>.</li>
<li>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan -->1 February 2002<!--webbot bot="Timestamp" endspan i-checksum="14885" -->.</p> Originally submitted by <a href="../../people/greg_colvin.htm">Greg Colvin</a> and
<a href="../../people/beman_dawes.html">Beman Dawes</a>, currently maintained
</body> by <a href="../../people/peter_dimov.htm">Peter Dimov</a> and <a href="../../people/darin_adler.htm">
Darin Adler</a>.</li>
</ul>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan -->
1 February 2002<!--webbot bot="Timestamp" endspan i-checksum="14885" --> .</p>
</body>
</html> </html>

View File

@ -14,10 +14,9 @@
<p>The <b>scoped_ptr</b> template is a simple solution for simple needs. It <p>The <b>scoped_ptr</b> template is a simple solution for simple needs. It
supplies a basic "resource acquisition is initialization" facility, without supplies a basic "resource acquisition is initialization" facility, without
shared-ownership or transfer-of-ownership semantics. Both its name and shared-ownership or transfer-of-ownership semantics. Both its name and
enforcement of semantics (by being enforcement of semantics (by being <a href="../utility/utility.htm#Class_noncopyable">
<a href="../utility/utility.htm#Class_noncopyable">noncopyable</a>) signal its intent to retain ownership solely within the noncopyable</a>) signal its intent to retain ownership solely within the
current scope. Because it is current scope. Because it is <a href="../utility/utility.htm#Class_noncopyable">noncopyable</a>,
<a href="../utility/utility.htm#Class_noncopyable">noncopyable</a>,
it is safer than <b>shared_ptr</b> or <b>std::auto_ptr</b> for pointers which it is safer than <b>shared_ptr</b> or <b>std::auto_ptr</b> for pointers which
should not be copied.</p> should not be copied.</p>
<p>Because <b>scoped_ptr</b> is simple, in its usual implementation every operation <p>Because <b>scoped_ptr</b> is simple, in its usual implementation every operation
@ -151,12 +150,12 @@ Buckle my shoe</pre>
<p>One common usage of <b>scoped_ptr</b> is to implement a handle/body (also called <p>One common usage of <b>scoped_ptr</b> is to implement a handle/body (also called
pimpl) idiom which avoids exposing the body (implementation) in the header pimpl) idiom which avoids exposing the body (implementation) in the header
file.</p> file.</p>
<p>The <a href="scoped_ptr_example_test.cpp">scoped_ptr_example_test.cpp</a> sample <p>The <a href="example/scoped_ptr_example_test.cpp">scoped_ptr_example_test.cpp</a> sample
program includes a header file, <a href="scoped_ptr_example.hpp">scoped_ptr_example.hpp</a>, program includes a header file, <a href="example/scoped_ptr_example.hpp">scoped_ptr_example.hpp</a>,
which uses a <b>scoped_ptr&lt;&gt;</b> to an incomplete type to hide the which uses a <b>scoped_ptr&lt;&gt;</b> to an incomplete type to hide the
implementation. The instantiation of member functions which require a complete implementation. The instantiation of member functions which require a complete
type occurs in the <a href="scoped_ptr_example.cpp">scoped_ptr_example.cpp</a> implementation type occurs in the <a href="example/scoped_ptr_example.cpp">scoped_ptr_example.cpp</a>
file.</p> implementation file.</p>
<h2>Frequently Asked Questions</h2> <h2>Frequently Asked Questions</h2>
<p><b>Q</b>. Why doesn't <b>scoped_ptr</b> have a release() member?<br> <p><b>Q</b>. Why doesn't <b>scoped_ptr</b> have a release() member?<br>
<b>A</b>. When reading source code, it is valuable to be able to draw <b>A</b>. When reading source code, it is valuable to be able to draw
@ -166,7 +165,8 @@ Buckle my shoe</pre>
given context. Use <STRONG>std::auto_ptr</STRONG> where transfer of ownership given context. Use <STRONG>std::auto_ptr</STRONG> where transfer of ownership
is required. (supplied by Dave Abrahams)</p> is required. (supplied by Dave Abrahams)</p>
<hr> <hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan -->09 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32310" --></p> <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan -->
09 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32310" --></p>
<p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler. <p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
Copyright 2002 Peter Dimov. Permission to copy, use, modify, sell and Copyright 2002 Peter Dimov. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in distribute this document is granted provided this copyright notice appears in

View File

@ -26,8 +26,8 @@
<p>A <b>shared_ptr</b> to a <b>std::vector</b> is an alternative to a <b>shared_array</b> <p>A <b>shared_ptr</b> to a <b>std::vector</b> is an alternative to a <b>shared_array</b>
that is a bit heavier duty but far more flexible.</p> that is a bit heavier duty but far more flexible.</p>
<p>The class template is parameterized on <b>T</b>, the type of the object pointed <p>The class template is parameterized on <b>T</b>, the type of the object pointed
to. <b>T</b> must meet the smart pointer to. <b>T</b> must meet the smart pointer <a href="smart_ptr.htm#common_requirements">
<a href="smart_ptr.htm#common_requirements">common requirements</a>.</p> common requirements</a>.</p>
<h2>Synopsis</h2> <h2>Synopsis</h2>
<pre>namespace boost { <pre>namespace boost {
@ -98,8 +98,8 @@
The guarantee that this does not throw exceptions depends on the requirement The guarantee that this does not throw exceptions depends on the requirement
that the deleted object's destructor does not throw exceptions. See the smart that the deleted object's destructor does not throw exceptions. See the smart
pointer <a href="smart_ptr.htm#common_requirements">common requirements</a>.</p> pointer <a href="smart_ptr.htm#common_requirements">common requirements</a>.</p>
<h3><a name="operator=">assignment</a></h3> <h3><a name="assignment">assignment</a></h3>
<pre>shared_array &amp; <a href="#assignment">operator=</a>(shared_array const &amp; r); // never throws</pre> <pre>shared_array &amp; operator=(shared_array const &amp; r); // never throws</pre>
<p>Constructs a new <b>shared_array</b> as described <a href="#constructors">above</a>, <p>Constructs a new <b>shared_array</b> as described <a href="#constructors">above</a>,
then replaces this <b>shared_array</b> with the new one, destroying the then replaces this <b>shared_array</b> with the new one, destroying the
replaced object.</p> replaced object.</p>
@ -115,7 +115,7 @@
replaced object. <b>D</b>'s copy constructor must not throw. The only exception replaced object. <b>D</b>'s copy constructor must not throw. The only exception
which may be thrown is <b>std::bad_alloc</b>. If an exception is thrown, <b>d(p)</b> which may be thrown is <b>std::bad_alloc</b>. If an exception is thrown, <b>d(p)</b>
is called.</p> is called.</p>
<h3><a name="indirection">indexing</a></h3> <h3><a name="indexing">indexing</a></h3>
<pre>T &amp; operator[](std::ptrdiff_t i) const; // never throws</pre> <pre>T &amp; operator[](std::ptrdiff_t i) const; // never throws</pre>
<p>Returns a reference to element <b>i</b> of the array pointed to by the stored <p>Returns a reference to element <b>i</b> of the array pointed to by the stored
pointer. Behavior is undefined and almost certainly undesirable if the stored pointer. Behavior is undefined and almost certainly undesirable if the stored
@ -169,7 +169,8 @@ template&lt;class T&gt;
Provided as an aid to generic programming.</p> Provided as an aid to generic programming.</p>
<hr> <hr>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->09 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32310" --></p> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->
09 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32310" --></p>
<p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler. <p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
Permission to copy, use, modify, sell and distribute this document is granted Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided provided this copyright notice appears in all copies. This document is provided

View File

@ -361,9 +361,9 @@ q = p;
<h3><a name="use_count">use_count</a></h3> <h3><a name="use_count">use_count</a></h3>
<pre>long use_count() const; // never throws</pre> <pre>long use_count() const; // never throws</pre>
<blockquote> <blockquote>
<p><b>Returns:</b> the number of <b>shared_ptr</b> objects, <STRONG>*this</STRONG> included, that <p><b>Returns:</b> the number of <b>shared_ptr</b> objects, <STRONG>*this</STRONG> included,
<i>share ownership</i> with <b>*this</b>, or an unspecified nonnegative value that <i>share ownership</i> with <b>*this</b>, or an unspecified nonnegative
when <STRONG>*this</STRONG> is <EM>empty</EM>.</p> value when <STRONG>*this</STRONG> is <EM>empty</EM>.</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>
@ -490,9 +490,9 @@ q = p;
<P><B>Returns:</B> <b>os</b>.</P> <P><B>Returns:</B> <b>os</b>.</P>
</BLOCKQUOTE> </BLOCKQUOTE>
<h2><a name="example">Example</a></h2> <h2><a name="example">Example</a></h2>
<p>See <A href="shared_ptr_example.cpp">shared_ptr_example.cpp</A> for a complete <p>See <A href="example/shared_ptr_example.cpp">shared_ptr_example.cpp</A> for a
example program. The program builds a <b>std::vector</b> and <b>std::set</b> of <b>shared_ptr</b> complete example program. The program builds a <b>std::vector</b> and <b>std::set</b>
objects.</p> of <b>shared_ptr</b> objects.</p>
<p>Note that after the containers have been populated, some of the <b>shared_ptr</b> <p>Note that after the containers have been populated, some of the <b>shared_ptr</b>
objects will have a use count of 1 rather than a use count of 2, since the set objects will have a use count of 1 rather than a use count of 2, since the set
is a <b>std::set</b> rather than a <b>std::multiset</b>, and thus does not is a <b>std::set</b> rather than a <b>std::multiset</b>, and thus does not
@ -505,11 +505,11 @@ q = p;
<p>One common usage of <b>shared_ptr</b> is to implement a handle/body (also called <p>One common usage of <b>shared_ptr</b> is to implement a handle/body (also called
pimpl) idiom which avoids exposing the body (implementation) in the header pimpl) idiom which avoids exposing the body (implementation) in the header
file.</p> file.</p>
<p>The <A href="shared_ptr_example2_test.cpp">shared_ptr_example2_test.cpp</A> sample <p>The <A href="example/shared_ptr_example2_test.cpp">shared_ptr_example2_test.cpp</A>
program includes a header file, <A href="shared_ptr_example2.hpp">shared_ptr_example2.hpp</A>, sample program includes a header file, <A href="example/shared_ptr_example2.hpp">shared_ptr_example2.hpp</A>,
which uses a <b>shared_ptr&lt;&gt;</b> to an incomplete type to hide the which uses a <b>shared_ptr&lt;&gt;</b> to an incomplete type to hide the
implementation. The instantiation of member functions which require a complete implementation. The instantiation of member functions which require a complete
type occurs in the <A href="shared_ptr_example2.cpp">shared_ptr_example2.cpp</A> type occurs in the <A href="example/shared_ptr_example2.cpp">shared_ptr_example2.cpp</A>
implementation file. Note that there is no need for an explicit destructor. implementation file. Note that there is no need for an explicit destructor.
Unlike ~scoped_ptr, ~shared_ptr does not require that <b>T</b> be a complete Unlike ~scoped_ptr, ~shared_ptr does not require that <b>T</b> be a complete
type.</p> type.</p>

View File

@ -56,7 +56,7 @@
<p>They are examples of the "resource acquisition is initialization" idiom <p>They are examples of the "resource acquisition is initialization" idiom
described in Bjarne Stroustrup's "The C++ Programming Language", 3rd edition, described in Bjarne Stroustrup's "The C++ Programming Language", 3rd edition,
Section 14.4, Resource Management.</p> Section 14.4, Resource Management.</p>
<p>A test program, <a href="smart_ptr_test.cpp">smart_ptr_test.cpp</a>, is provided <p>A test program, <a href="test/smart_ptr_test.cpp">smart_ptr_test.cpp</a>, is provided
to verify correct operation.</p> to verify correct operation.</p>
<p>A page on <a href="compatibility.htm">compatibility</a> with older versions of <p>A page on <a href="compatibility.htm">compatibility</a> with older versions of
the Boost smart pointer library describes some of the changes since earlier the Boost smart pointer library describes some of the changes since earlier
@ -121,11 +121,11 @@
<p>September 1999. Luis Coelho provided <b>shared_ptr::swap</b> and <b>shared_array::swap</b></p> <p>September 1999. Luis Coelho provided <b>shared_ptr::swap</b> and <b>shared_array::swap</b></p>
<p>May 1999. In April and May, 1999, Valentin Bonnard and David Abrahams made a <p>May 1999. In April and May, 1999, Valentin Bonnard and David Abrahams made a
number of suggestions resulting in numerous improvements.</p> number of suggestions resulting in numerous improvements.</p>
<p>October 1998. Beman Dawes proposed reviving the original semantics under the names <b>safe_ptr</b> <p>October 1998. Beman Dawes proposed reviving the original semantics under the
and <b>counted_ptr</b>, meeting of Per Andersson, Matt names <b>safe_ptr</b> and <b>counted_ptr</b>, meeting of Per Andersson, Matt
Austern, Greg Colvin, Sean Corfield, Pete Becker, Nico Josuttis, Dietmar K<>hl, Austern, Greg Colvin, Sean Corfield, Pete Becker, Nico Josuttis, Dietmar K<>hl,
Nathan Myers, Chichiang Wan and Judy Ward. During the discussion, the four Nathan Myers, Chichiang Wan and Judy Ward. During the discussion, the four new
new class names were finalized, it was decided that there was no need to exactly class names were finalized, it was decided that there was no need to exactly
follow the <b>std::auto_ptr</b> interface, and various function signatures and follow the <b>std::auto_ptr</b> interface, and various function signatures and
semantics were finalized.</p> semantics were finalized.</p>
<p>Over the next three months, several implementations were considered for <b>shared_ptr</b>, <p>Over the next three months, several implementations were considered for <b>shared_ptr</b>,
@ -154,26 +154,24 @@
experimented with.</p> experimented with.</p>
<p>But Greg Colvin and Jerry Schwarz argued that "parameterization will discourage <p>But Greg Colvin and Jerry Schwarz argued that "parameterization will discourage
users", and in the end we choose to supply only the direct implementation.</p> users", and in the end we choose to supply only the direct implementation.</p>
<p>Summer, 1994. Greg Colvin proposed to the C++ Standards Committee <p>Summer, 1994. Greg Colvin proposed to the C++ Standards Committee classes named <b>auto_ptr</b>
classes named <b>auto_ptr</b> and <b>counted_ptr</b> which were very similar to and <b>counted_ptr</b> which were very similar to what we now call <b>scoped_ptr</b>
what we now call <b>scoped_ptr</b> and <b>shared_ptr</b>. and <b>shared_ptr</b>. <a href="#Col-94">[Col-94]</a> In one of the very few
<a href="#Col-94">[Col-94]</a> In one of the very cases where the Library Working Group's recommendations were not followed by
few cases where the Library Working Group's recommendations were not followed the full committee, <b>counted_ptr</b> was rejected and surprising
by the full committee, <b>counted_ptr</b> was rejected and surprising
transfer-of-ownership semantics were added to <b>auto_ptr</b>.</p> transfer-of-ownership semantics were added to <b>auto_ptr</b>.</p>
<h2><a name="References">References</a></h2> <h2><a name="References">References</a></h2>
<p>[<a name="Col-94">Col-94</a>] Gregory Colvin, <p>[<a name="Col-94">Col-94</a>] Gregory Colvin, <a href="http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/1994/N0555.pdf">
<a href="http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/1994/N0555.pdf">
Exception Safe Smart Pointers</a>, C++ committee document 94-168/N0555, Exception Safe Smart Pointers</a>, C++ committee document 94-168/N0555,
July, 1994.</p> July, 1994.</p>
<p>[<a name="E&amp;D-94">E&amp;D-94</a>] John R. Ellis &amp; David L. Detlefs, <p>[<a name="E&amp;D-94">E&amp;D-94</a>] John R. Ellis &amp; David L. Detlefs, <a href="http://www.usenix.org/publications/library/proceedings/c++94/full_papers/ellis.a">
<a href="http://www.usenix.org/publications/library/proceedings/c++94/full_papers/ellis.a">
Safe, Efficient Garbage Collection for C++</a>, Usenix Proceedings, Safe, Efficient Garbage Collection for C++</a>, Usenix Proceedings,
February, 1994. This paper includes an extensive discussion of weak February, 1994. This paper includes an extensive discussion of weak pointers
pointers and an extensive bibliography.</p> and an extensive bibliography.</p>
<hr> <hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan
-->15 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32303" -->
15 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32303"
--></p> --></p>
<p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler. <p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
Permission to copy, use, modify, sell and distribute this document is granted Permission to copy, use, modify, sell and distribute this document is granted