From b60de38d28e804fa07f69b1589fc2087235937c9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 25 Jan 2003 17:58:01 +0000 Subject: [PATCH] Fixed broken links. [SVN r17044] --- index.htm | 88 ++++++++++++++++++++++++------------------------ scoped_ptr.htm | 20 +++++------ shared_array.htm | 15 +++++---- shared_ptr.htm | 18 +++++----- smart_ptr.htm | 52 ++++++++++++++-------------- 5 files changed, 96 insertions(+), 97 deletions(-) diff --git a/index.htm b/index.htm index 676c78c..f53a933 100644 --- a/index.htm +++ b/index.htm @@ -1,47 +1,47 @@ - - - - -Boost Smart Pointer Library - - - - - - - - - - - - - -
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore
-

Smart Pointer Library

-

The smart pointer library includes five smart pointer class templates. Smart -pointers ease the management of memory dynamically allocated with C++ new -expressions. In addition, scoped_ptr can ease the management of memory -dynamically allocated in other ways.

- - -

Revised 1 February 2002.

- - - + + + Boost Smart Pointer Library + + + + + + + + + + + +
c++boost.gif (8819 bytes)HomeLibrariesPeopleFAQMore
+

Smart Pointer Library

+

The smart pointer library includes five smart pointer class templates. Smart + pointers ease the management of memory dynamically allocated with C++ new + expressions. In addition, scoped_ptr can ease the management of memory + dynamically allocated in other ways.

+ +

Revised + 1 February 2002 .

+ diff --git a/scoped_ptr.htm b/scoped_ptr.htm index 4c1dba9..4a15223 100644 --- a/scoped_ptr.htm +++ b/scoped_ptr.htm @@ -14,10 +14,9 @@

The scoped_ptr template is a simple solution for simple needs. It supplies a basic "resource acquisition is initialization" facility, without shared-ownership or transfer-of-ownership semantics. Both its name and - enforcement of semantics (by being - noncopyable) signal its intent to retain ownership solely within the - current scope. Because it is - noncopyable, + enforcement of semantics (by being + noncopyable) signal its intent to retain ownership solely within the + current scope. Because it is noncopyable, it is safer than shared_ptr or std::auto_ptr for pointers which should not be copied.

Because scoped_ptr is simple, in its usual implementation every operation @@ -151,12 +150,12 @@ Buckle my shoe

One common usage of scoped_ptr is to implement a handle/body (also called pimpl) idiom which avoids exposing the body (implementation) in the header file.

-

The scoped_ptr_example_test.cpp sample - program includes a header file, scoped_ptr_example.hpp, +

The scoped_ptr_example_test.cpp sample + program includes a header file, scoped_ptr_example.hpp, which uses a scoped_ptr<> to an incomplete type to hide the implementation. The instantiation of member functions which require a complete - type occurs in the scoped_ptr_example.cpp implementation - file.

+ type occurs in the scoped_ptr_example.cpp + implementation file.

Frequently Asked Questions

Q. Why doesn't scoped_ptr have a release() member?
A. When reading source code, it is valuable to be able to draw @@ -166,11 +165,12 @@ Buckle my shoe given context. Use std::auto_ptr where transfer of ownership is required. (supplied by Dave Abrahams)


-

Revised 09 January 2003

+

Revised + 09 January 2003

Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler. Copyright 2002 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.

- \ No newline at end of file + diff --git a/shared_array.htm b/shared_array.htm index ecf84ae..f4d5f04 100644 --- a/shared_array.htm +++ b/shared_array.htm @@ -26,8 +26,8 @@

A shared_ptr to a std::vector is an alternative to a shared_array that is a bit heavier duty but far more flexible.

The class template is parameterized on T, the type of the object pointed - to. T must meet the smart pointer - common requirements.

+ to. T must meet the smart pointer + common requirements.

Synopsis

namespace boost {
 
@@ -98,8 +98,8 @@
 			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 
 			pointer common requirements.

-

assignment

-
shared_array & operator=(shared_array const & r); // never throws
+

assignment

+
shared_array & operator=(shared_array const & r); // never throws

Constructs a new shared_array as described above, then replaces this shared_array with the new one, destroying the replaced object.

@@ -115,7 +115,7 @@ replaced object. D's copy constructor must not throw. The only exception which may be thrown is std::bad_alloc. If an exception is thrown, d(p) is called.

-

indexing

+

indexing

T & operator[](std::ptrdiff_t i) const; // never throws

Returns a reference to element i of the array pointed to by the stored pointer. Behavior is undefined and almost certainly undesirable if the stored @@ -169,11 +169,12 @@ template<class T> Provided as an aid to generic programming.


Revised - 09 January 2003

+ + 09 January 2003

Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler. 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.

- \ No newline at end of file + diff --git a/shared_ptr.htm b/shared_ptr.htm index 0f7d49d..652cc49 100644 --- a/shared_ptr.htm +++ b/shared_ptr.htm @@ -361,9 +361,9 @@ q = p;

use_count

long use_count() const; // never throws
-

Returns: the number of shared_ptr objects, *this included, that - share ownership with *this, or an unspecified nonnegative value - when *this is empty.

+

Returns: the number of shared_ptr objects, *this included, + that share ownership with *this, or an unspecified nonnegative + value when *this is empty.

Throws: nothing.

Notes: use_count() is not necessarily efficient. Use only for debugging and testing purposes, not for production code.

@@ -490,9 +490,9 @@ q = p;

Returns: os.

Example

-

See shared_ptr_example.cpp for a complete - example program. The program builds a std::vector and std::set of shared_ptr - objects.

+

See shared_ptr_example.cpp for a + complete example program. The program builds a std::vector and std::set + of shared_ptr objects.

Note that after the containers have been populated, some of the shared_ptr objects will have a use count of 1 rather than a use count of 2, since the set is a std::set rather than a std::multiset, and thus does not @@ -505,11 +505,11 @@ q = p;

One common usage of shared_ptr is to implement a handle/body (also called pimpl) idiom which avoids exposing the body (implementation) in the header file.

-

The shared_ptr_example2_test.cpp sample - program includes a header file, shared_ptr_example2.hpp, +

The shared_ptr_example2_test.cpp + sample program includes a header file, shared_ptr_example2.hpp, which uses a shared_ptr<> to an incomplete type to hide the implementation. The instantiation of member functions which require a complete - type occurs in the shared_ptr_example2.cpp + type occurs in the shared_ptr_example2.cpp implementation file. Note that there is no need for an explicit destructor. Unlike ~scoped_ptr, ~shared_ptr does not require that T be a complete type.

diff --git a/smart_ptr.htm b/smart_ptr.htm index 6873980..bec58f1 100644 --- a/smart_ptr.htm +++ b/smart_ptr.htm @@ -8,11 +8,11 @@

c++boost.gif (8819 bytes)Smart Pointers

Introduction
- Common Requirements
- Exception Safety
- Exception-specifications
- History and Acknowledgements
- References

+ Common Requirements
+ Exception Safety
+ Exception-specifications
+ History and Acknowledgements
+ References

Introduction

Smart pointers are objects which store pointers to dynamically allocated (heap) objects. They behave much like built-in C++ pointers except that they @@ -56,7 +56,7 @@

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.

-

A test program, smart_ptr_test.cpp, is provided +

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

A page on compatibility with older versions of the Boost smart pointer library describes some of the changes since earlier @@ -121,11 +121,11 @@

September 1999. Luis Coelho provided shared_ptr::swap and shared_array::swap

May 1999. In April and May, 1999, Valentin Bonnard and David Abrahams made a 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 +

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, - 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 + 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 semantics were finalized.

Over the next three months, several implementations were considered for shared_ptr, @@ -154,26 +154,24 @@ experimented with.

But Greg Colvin and Jerry Schwarz argued that "parameterization will discourage users", and in the end we choose to supply only the direct implementation.

-

Summer, 1994. Greg Colvin proposed to the C++ Standards Committee - classes named auto_ptr and counted_ptr which were very similar to - what we now call scoped_ptr and shared_ptr. - [Col-94] In one of the very - few cases where the Library Working Group's recommendations were not followed - by the full committee, counted_ptr was rejected and surprising +

Summer, 1994. Greg Colvin proposed to the C++ Standards Committee classes named auto_ptr + and counted_ptr which were very similar to what we now call scoped_ptr + and shared_ptr. [Col-94] In one of the very few + cases where the Library Working Group's recommendations were not followed by + the full committee, counted_ptr was rejected and surprising transfer-of-ownership semantics were added to auto_ptr.

References

-

[Col-94] Gregory Colvin, - - Exception Safe Smart Pointers, C++ committee document 94-168/N0555, - July, 1994.

-

[E&D-94] John R. Ellis & David L. Detlefs, - - Safe, Efficient Garbage Collection for C++, Usenix Proceedings, - February, 1994. This paper includes an extensive discussion of weak - pointers and an extensive bibliography.

+

[Col-94] Gregory Colvin, + Exception Safe Smart Pointers, C++ committee document 94-168/N0555, + July, 1994.

+

[E&D-94] John R. Ellis & David L. Detlefs, + Safe, Efficient Garbage Collection for C++, Usenix Proceedings, + February, 1994. This paper includes an extensive discussion of weak pointers + and an extensive bibliography.


Revised 15 January 2003 + 15 January 2003

Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler. Permission to copy, use, modify, sell and distribute this document is granted @@ -181,4 +179,4 @@ "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.

- \ No newline at end of file +