diff --git a/scoped_array.htm b/scoped_array.htm index 2e1081c..93b1cf9 100644 --- a/scoped_array.htm +++ b/scoped_array.htm @@ -5,8 +5,8 @@
-The scoped_array class template stores a pointer to a dynamically allocated array. (Dynamically allocated arrays are allocated with the C++ new[] expression.) The array pointed to is guaranteed to be deleted, either on @@ -14,10 +14,9 @@
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 @@ -48,6 +47,8 @@ T & operator[](std::ptrdiff_t i) const; // never throws T * get() const; // never throws + operator unspecified-bool-type() const; // never throws + void swap(scoped_array & b); // never throws }; @@ -90,6 +91,10 @@
T * get() const; // never throws
Returns the stored pointer. T need not be a complete type. See the smart pointer common requirements.
+operator unspecified-bool-type () const; // never throws+
Returns an unspecified value that, when used in boolean contexts, is equivalent
+ to get() != 0
.
void swap(scoped_array & b); // never throws
Exchanges the contents of the two smart pointers. T need not be a @@ -101,11 +106,12 @@
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 - "as is" without express or implied warranty, and with no claim as to its - suitability for any purpose.
+ Copyright 2002-2005 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. -