Index: libs/smart_ptr/shared_ptr.htm =================================================================== --- libs/smart_ptr/shared_ptr.htm (revision 45553) +++ libs/smart_ptr/shared_ptr.htm (working copy) @@ -90,6 +90,11 @@ shared_ptr constructor if g throws an exception. See Herb Sutter's treatment (also here) of the issue for more information.

+

The exception safety problem described above may also be eliminated by using + the make_shared + or allocate_shared + factory functions defined in boost/make_shared.hpp. These factory functions also provide + an efficiency benefit by consolidating allocations.

Synopsis

namespace boost {
 
Index: libs/smart_ptr/smart_ptr.htm
===================================================================
--- libs/smart_ptr/smart_ptr.htm	(revision 45553)
+++ libs/smart_ptr/smart_ptr.htm	(working copy)
@@ -22,7 +22,8 @@
 			keep track of dynamically allocated objects shared by multiple owners.

Conceptually, smart pointers are seen as owning the object pointed to, and thus responsible for deletion of the object when it is no longer needed.

-

The smart pointer library provides five smart pointer class templates:

+

The smart pointer library provides six smart pointer class templates, plus + efficient factory functions for shared_ptr:

@@ -38,7 +39,7 @@ - + @@ -61,6 +62,17 @@

They are examples of the "resource acquisition is initialization" idiom described in Bjarne Stroustrup's "The C++ Programming Language", 3rd edition, Section 14.4, Resource Management.

+

Additionally, the smart pointer library provides efficient factory functions + for creating shared_ptr objects:

+
+
shared_ptr <boost/shared_ptr.hpp>Object ownership shared among multiple pointersObject ownership shared among multiple pointers.
shared_array
+ + + + + +
make_shared and allocate_shared<boost/make_shared.hpp>Efficient creation of shared_ptr objects.
+

A test program, smart_ptr_test.cpp, is provided to verify correct operation.

A page on compatibility with older versions of @@ -130,7 +142,7 @@ number of suggestions resulting in numerous improvements.

October 1998. Beman Dawes proposed reviving the original semantics under the names safe_ptr and counted_ptr, 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 new class names were finalized, it was decided that there was no need to exactly follow the std::auto_ptr interface, and various function signatures and @@ -156,7 +168,7 @@ as to run various timings of the direct and indirect approaches, and found that at least on Intel Pentium chips there was very little measurable difference. Kevlin Henney provided a paper he wrote on "Counted Body Techniques." Dietmar - Kühl suggested an elegant partial template specialization technique to allow + Kühl suggested an elegant partial template specialization technique to allow users to choose which implementation they preferred, and that was also experimented with.

But Greg Colvin and Jerry Schwarz argued that "parameterization will discourage