mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-08-03 06:34:26 +02:00
Add TOC and References sections
[SVN r16912]
This commit is contained in:
@@ -7,6 +7,13 @@
|
||||
<body bgcolor="#ffffff" text="#000000">
|
||||
<h1><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" align="middle" width="277" height="86">Smart
|
||||
Pointers</h1>
|
||||
<p><a href="#Introduction">Introduction</a><br>
|
||||
<a href="#common_requirements">Common Requirements</a><br>
|
||||
<a href="#Exception_Safety">Exception Safety</a><br>
|
||||
<a href="#Exception-specifications">Exception-specifications</a><br>
|
||||
<a href="#History">History and Acknowledgements</a><br>
|
||||
<a href="#References">References</a></p>
|
||||
<h2><a name="Introduction">Introduction</a></h2>
|
||||
<p>Smart pointers are objects which store pointers to dynamically allocated (heap)
|
||||
objects. They behave much like built-in C++ pointers except that they
|
||||
automatically delete the object pointed to at the appropriate time. Smart
|
||||
@@ -79,7 +86,7 @@
|
||||
these idioms.</p>
|
||||
<p>Note that <b>scoped_ptr</b> requires that <b>T</b> be a complete type at
|
||||
destruction time, but <b>shared_ptr</b> does not.</p>
|
||||
<h2>Exception Safety</h2>
|
||||
<h2><a name="Exception_Safety">Exception Safety</a></h2>
|
||||
<p>Several functions in these smart pointer classes are specified as having "no
|
||||
effect" or "no effect except such-and-such" if an exception is thrown. This
|
||||
means that when an exception is thrown by an object of one of these classes,
|
||||
@@ -90,7 +97,7 @@
|
||||
the <a href="#common_requirements">common requirements</a>) is <b>std::bad_alloc</b>,
|
||||
and that is thrown only by functions which are explicitly documented as
|
||||
possibly throwing <b>std::bad_alloc</b>.</p>
|
||||
<h2>Exception-specifications</h2>
|
||||
<h2><a name="Exception-specifications">Exception-specifications</a></h2>
|
||||
<p>Exception-specifications are not used; see <a href="../../more/lib_guide.htm#Exception-specification">
|
||||
exception-specification rationale</a>.</p>
|
||||
<p>All the smart pointer templates contain member functions which can never throw
|
||||
@@ -100,7 +107,7 @@
|
||||
</p>
|
||||
<p>Functions which destroy objects of the pointed to type are prohibited from
|
||||
throwing exceptions by the <a href="#common_requirements">common requirements</a>.</p>
|
||||
<h2>History and Acknowledgements</h2>
|
||||
<h2><a name="History">History</a> and Acknowledgements</h2>
|
||||
<p>January 2002. Peter Dimov reworked all four classes, adding features, fixing
|
||||
bugs, and splitting them into four separate headers, and added <b>weak_ptr</b>.
|
||||
See the <a href="compatibility.htm">compatibility</a> page for a summary of the
|
||||
@@ -114,18 +121,11 @@
|
||||
<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
|
||||
number of suggestions resulting in numerous improvements.</p>
|
||||
<p>October 1998. In 1994 Greg Colvin proposed to the C++ Standards Committee
|
||||
classes named <b>auto_ptr</b> and <b>counted_ptr</b> which were very similar to
|
||||
what we now call <b>scoped_ptr</b> and <b>shared_ptr</b>. The committee
|
||||
document was 94-168/N0555, Exception Safe Smart Pointers. In one of the very
|
||||
few cases where the Library Working Group's recommendations were not followed
|
||||
by the full committee, <b>counted_ptr</b> was rejected and surprising
|
||||
transfer-of-ownership semantics were added to <b>auto_ptr</b>.</p>
|
||||
<p>Beman Dawes proposed reviving the original semantics under the names <b>safe_ptr</b>
|
||||
and <b>counted_ptr</b> at an October, 1998, meeting of Per Andersson, Matt
|
||||
<p>October 1998. Beman Dawes proposed reviving the original semantics under the 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,
|
||||
Nathan Myers, Chichiang Wan and Judy Ward. During the discussion, the four
|
||||
class names were finalized, it was decided that there was no need to exactly
|
||||
new 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
|
||||
semantics were finalized.</p>
|
||||
<p>Over the next three months, several implementations were considered for <b>shared_ptr</b>,
|
||||
@@ -154,10 +154,26 @@
|
||||
experimented with.</p>
|
||||
<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>
|
||||
<p>Summer, 1994. Greg Colvin proposed to the C++ Standards Committee
|
||||
classes named <b>auto_ptr</b> and <b>counted_ptr</b> which were very similar to
|
||||
what we now call <b>scoped_ptr</b> and <b>shared_ptr</b>.
|
||||
<a href="#Col-94">[Col-94]</a> In one of the very
|
||||
few cases where the Library Working Group's recommendations were not followed
|
||||
by the full committee, <b>counted_ptr</b> was rejected and surprising
|
||||
transfer-of-ownership semantics were added to <b>auto_ptr</b>.</p>
|
||||
<h2><a name="References">References</a></h2>
|
||||
<p>[<a name="Col-94">Col-94</a>] Gregory Colvin,
|
||||
<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,
|
||||
July, 1994.</p>
|
||||
<p>[<a name="E&D-94">E&D-94</a>] John R. Ellis & David L. Detlefs,
|
||||
<a href="http://www.usenix.org/publications/library/proceedings/c++94/full_papers/ellis.a">
|
||||
Safe, Efficient Garbage Collection for C++</a>, Usenix Proceedings,
|
||||
February, 1994. This paper includes an extensive discussion of weak
|
||||
pointers and an extensive bibliography.</p>
|
||||
<hr>
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan
|
||||
-->
|
||||
4 February 2002<!--webbot bot="Timestamp" endspan i-checksum="40737"
|
||||
-->15 January 2003<!--webbot bot="Timestamp" endspan i-checksum="32303"
|
||||
--></p>
|
||||
<p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
|
||||
Permission to copy, use, modify, sell and distribute this document is granted
|
||||
@@ -165,4 +181,4 @@
|
||||
"as is" without express or implied warranty, and with no claim as to its
|
||||
suitability for any purpose.</p>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
Reference in New Issue
Block a user