From 8eaf187dbdb91daecbdffb0fbde1c3ff7ff08cb8 Mon Sep 17 00:00:00 2001
From: Beman Dawes The scoped_array 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_array for pointers which should not be copied. Because scoped_array is so simple, in its usual implementation every
operation is as fast as a built-in array pointer and it has no more space
diff --git a/scoped_ptr.htm b/scoped_ptr.htm
index 8af72c4..4c1dba9 100644
--- a/scoped_ptr.htm
+++ b/scoped_ptr.htm
@@ -14,9 +14,10 @@
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
diff --git a/shared_array.htm b/shared_array.htm
index 8a7cc34..ecf84ae 100644
--- a/shared_array.htm
+++ b/shared_array.htm
@@ -97,7 +97,7 @@
a pointer with a value of 0 is harmless. T need not be a complete type.
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.
shared_array & operator=(shared_array const & r); // never throws
Constructs a new shared_array as described above, @@ -124,16 +124,16 @@
T * get() const; // never throws
Returns the stored pointer. T need not be a complete type. See the smart - pointer common requirements.
+ pointer common requirements.bool unique() const; // never throws
Returns true if no other shared_array is sharing ownership of the stored pointer, false otherwise. T need not be a complete type. See the smart - pointer common requirements.
+ pointer common requirements.long use_count() const; // never throws
Returns the number of shared_array objects sharing ownership of the - stored pointer. T need not be a complete type. See the smart pointer + stored pointer. T need not be a complete type. See the smart pointer common requirements.
Because use_count is not necessarily efficient to implement for implementations of shared_array that do not use an explicit reference @@ -142,7 +142,7 @@
void swap(shared_ptr & b); // never throws
Exchanges the contents of the two smart pointers. T need not be a - complete type. See the smart pointer common + complete type. See the smart pointer common requirements.
Compares the stored pointers of the two smart pointers. T need not be a - complete type. See the smart pointer common + complete type. See the smart pointer common requirements.
The operator< overload is provided to define an ordering so that shared_array objects can be used in associative containers such as std::map. The @@ -168,7 +168,8 @@ template<class T>
Equivalent to a.swap(b). Matches the interface of std::swap. Provided as an aid to generic programming.
Revised 09 January 2003
+Revised + 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