forked from boostorg/smart_ptr
Tweaks.
[SVN r12715]
This commit is contained in:
@ -27,7 +27,7 @@ template<typename T> class scoped_array // noncopyable
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
T* ptr;
|
T * ptr;
|
||||||
|
|
||||||
scoped_array(scoped_array const &);
|
scoped_array(scoped_array const &);
|
||||||
scoped_array & operator=(scoped_array const &);
|
scoped_array & operator=(scoped_array const &);
|
||||||
@ -57,14 +57,14 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
T& operator[](std::ptrdiff_t i) const // never throws
|
T & operator[](std::ptrdiff_t i) const // never throws
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(ptr != 0);
|
BOOST_ASSERT(ptr != 0);
|
||||||
BOOST_ASSERT(i >= 0);
|
BOOST_ASSERT(i >= 0);
|
||||||
return ptr[i];
|
return ptr[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
T* get() const // never throws
|
T * get() const // never throws
|
||||||
{
|
{
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
@ -197,10 +197,10 @@ See the smart pointer
|
|||||||
<a href="smart_ptr.htm#Common requirements">common requirements</a>.</p>
|
<a href="smart_ptr.htm#Common requirements">common requirements</a>.</p>
|
||||||
<p>The <b>operator<</b> overload is provided to define an ordering so that <b>shared_array</b>
|
<p>The <b>operator<</b> overload is provided to define an ordering so that <b>shared_array</b>
|
||||||
objects can be used in associative containers such as <b>std::map</b>.
|
objects can be used in associative containers such as <b>std::map</b>.
|
||||||
The implementation uses std::less<T*> to perform the
|
The implementation uses <b>std::less<T *></b> to perform the
|
||||||
comparison. This ensures that the comparison is handled correctly, since the
|
comparison. This ensures that the comparison is handled correctly, since the
|
||||||
standard mandates that relational operations on pointers are unspecified (5.9 [expr.rel]
|
standard mandates that relational operations on pointers are unspecified (5.9 [expr.rel]
|
||||||
paragraph 2) but std::less<> on pointers is well-defined (20.3.3 [lib.comparisons]
|
paragraph 2) but <b>std::less<></b> on pointers is well-defined (20.3.3 [lib.comparisons]
|
||||||
paragraph 8).</p>
|
paragraph 8).</p>
|
||||||
|
|
||||||
<h3><a name="free-swap">swap</a></h3>
|
<h3><a name="free-swap">swap</a></h3>
|
||||||
|
@ -230,10 +230,10 @@ See the smart pointer
|
|||||||
<a href="smart_ptr.htm#Common requirements">common requirements</a>.</p>
|
<a href="smart_ptr.htm#Common requirements">common requirements</a>.</p>
|
||||||
<p>The <b>operator<</b> overload is provided to define an ordering so that <b>shared_ptr</b>
|
<p>The <b>operator<</b> overload is provided to define an ordering so that <b>shared_ptr</b>
|
||||||
objects can be used in associative containers such as <b>std::map</b>.
|
objects can be used in associative containers such as <b>std::map</b>.
|
||||||
The implementation uses std::less<T*> to perform the
|
The implementation uses <b>std::less<T *></b> to perform the
|
||||||
comparison. This ensures that the comparison is handled correctly, since the
|
comparison. This ensures that the comparison is handled correctly, since the
|
||||||
standard mandates that relational operations on pointers are unspecified (5.9 [expr.rel]
|
standard mandates that relational operations on pointers are unspecified (5.9 [expr.rel]
|
||||||
paragraph 2) but std::less<> on pointers is well-defined (20.3.3 [lib.comparisons]
|
paragraph 2) but <b>std::less<></b> on pointers is well-defined (20.3.3 [lib.comparisons]
|
||||||
paragraph 8).</p>
|
paragraph 8).</p>
|
||||||
|
|
||||||
<h3><a name="free-swap">swap</a></h3>
|
<h3><a name="free-swap">swap</a></h3>
|
||||||
|
@ -196,7 +196,7 @@ implementation.</p>
|
|||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan
|
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan
|
||||||
-->04 February 2002<!--webbot bot="Timestamp" endspan i-checksum="40737"
|
-->4 February 2002<!--webbot bot="Timestamp" endspan i-checksum="40737"
|
||||||
--></p>
|
--></p>
|
||||||
|
|
||||||
<p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
|
<p>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
|
||||||
|
@ -178,10 +178,10 @@ See the smart pointer
|
|||||||
<a href="smart_ptr.htm#Common requirements">common requirements</a>.</p>
|
<a href="smart_ptr.htm#Common requirements">common requirements</a>.</p>
|
||||||
<p>The <b>operator<</b> overload is provided to define an ordering so that <b>weak_ptr</b>
|
<p>The <b>operator<</b> overload is provided to define an ordering so that <b>weak_ptr</b>
|
||||||
objects can be used in associative containers such as <b>std::map</b>.
|
objects can be used in associative containers such as <b>std::map</b>.
|
||||||
The implementation uses std::less<T*> to perform the
|
The implementation uses <b>std::less<T *></b> to perform the
|
||||||
comparison. This ensures that the comparison is handled correctly, since the
|
comparison. This ensures that the comparison is handled correctly, since the
|
||||||
standard mandates that relational operations on pointers are unspecified (5.9 [expr.rel]
|
standard mandates that relational operations on pointers are unspecified (5.9 [expr.rel]
|
||||||
paragraph 2) but std::less<> on pointers is well-defined (20.3.3 [lib.comparisons]
|
paragraph 2) but <b>std::less<></b> on pointers is well-defined (20.3.3 [lib.comparisons]
|
||||||
paragraph 8).</p>
|
paragraph 8).</p>
|
||||||
|
|
||||||
<h3><a name="free-swap">swap</a></h3>
|
<h3><a name="free-swap">swap</a></h3>
|
||||||
|
Reference in New Issue
Block a user