mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-11-15 15:00:15 +01:00
Compare commits
9 Commits
boost-1.17
...
boost-1.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efdbcf2589 | ||
|
|
4e832788bf | ||
|
|
db43d160b4 | ||
|
|
1412e40490 | ||
|
|
00c5642eb4 | ||
|
|
d3347b6d08 | ||
|
|
ed7e13da9f | ||
|
|
90b7ec19d1 | ||
|
|
468c41041b |
@@ -9,6 +9,7 @@
|
|||||||
// See http://www.boost.org for most recent version including documentation.
|
// See http://www.boost.org for most recent version including documentation.
|
||||||
|
|
||||||
// Revision History
|
// Revision History
|
||||||
|
// 19 Oct 00 Make shared_ptr ctor from auto_ptr explicit. (Robert Vugts)
|
||||||
// 24 Jul 00 Change throw() to // never throws. See lib guidelines
|
// 24 Jul 00 Change throw() to // never throws. See lib guidelines
|
||||||
// Exception-specification rationale. (Beman Dawes)
|
// Exception-specification rationale. (Beman Dawes)
|
||||||
// 22 Jun 00 Remove #if continuations to fix GCC 2.95.2 problem (Beman Dawes)
|
// 22 Jun 00 Remove #if continuations to fix GCC 2.95.2 problem (Beman Dawes)
|
||||||
@@ -138,12 +139,13 @@ template<typename T> class shared_ptr {
|
|||||||
shared_ptr(const shared_ptr<Y>& r) : px(r.px) { // never throws
|
shared_ptr(const shared_ptr<Y>& r) : px(r.px) { // never throws
|
||||||
++*(pn = r.pn);
|
++*(pn = r.pn);
|
||||||
}
|
}
|
||||||
|
#ifndef BOOST_NO_AUTO_PTR
|
||||||
template<typename Y>
|
template<typename Y>
|
||||||
shared_ptr(std::auto_ptr<Y>& r) {
|
explicit shared_ptr(std::auto_ptr<Y>& r) {
|
||||||
pn = new long(1); // may throw
|
pn = new long(1); // may throw
|
||||||
px = r.release(); // fix: moved here to stop leak if new throws
|
px = r.release(); // fix: moved here to stop leak if new throws
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename Y>
|
template<typename Y>
|
||||||
shared_ptr& operator=(const shared_ptr<Y>& r) {
|
shared_ptr& operator=(const shared_ptr<Y>& r) {
|
||||||
@@ -151,6 +153,7 @@ template<typename T> class shared_ptr {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_AUTO_PTR
|
||||||
template<typename Y>
|
template<typename Y>
|
||||||
shared_ptr& operator=(std::auto_ptr<Y>& r) {
|
shared_ptr& operator=(std::auto_ptr<Y>& r) {
|
||||||
// code choice driven by guarantee of "no effect if new throws"
|
// code choice driven by guarantee of "no effect if new throws"
|
||||||
@@ -163,8 +166,10 @@ template<typename T> class shared_ptr {
|
|||||||
px = r.release(); // fix: moved here so doesn't leak if new throws
|
px = r.release(); // fix: moved here so doesn't leak if new throws
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
shared_ptr(std::auto_ptr<T>& r) {
|
#ifndef BOOST_NO_AUTO_PTR
|
||||||
|
explicit shared_ptr(std::auto_ptr<T>& r) {
|
||||||
pn = new long(1); // may throw
|
pn = new long(1); // may throw
|
||||||
px = r.release(); // fix: moved here to stop leak if new throws
|
px = r.release(); // fix: moved here to stop leak if new throws
|
||||||
}
|
}
|
||||||
@@ -180,6 +185,7 @@ template<typename T> class shared_ptr {
|
|||||||
px = r.release(); // fix: moved here so doesn't leak if new throws
|
px = r.release(); // fix: moved here so doesn't leak if new throws
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void reset(T* p=0) {
|
void reset(T* p=0) {
|
||||||
@@ -370,3 +376,4 @@ template<typename T>
|
|||||||
|
|
||||||
#endif // BOOST_SMART_PTR_HPP
|
#endif // BOOST_SMART_PTR_HPP
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td>
|
<td bgcolor="#FFFFFF"><img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td>
|
||||||
<td><a href="../../index.htm"><font face="Arial" color="#FFFFFF"><big>Home</big></font></a></td>
|
<td><a href="../../index.htm"><font face="Arial" color="#FFFFFF"><big>Home</big></font></a></td>
|
||||||
<td><a href="../../libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries</big></font></a></td>
|
<td><a href="../libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries</big></font></a></td>
|
||||||
<td><a href="../../people.htm"><font face="Arial" color="#FFFFFF"><big>People</big></font></a></td>
|
<td><a href="../../people/people.htm"><font face="Arial" color="#FFFFFF"><big>People</big></font></a></td>
|
||||||
<td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ</big></font></a></td>
|
<td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ</big></font></a></td>
|
||||||
<td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More</big></font></a></td>
|
<td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More</big></font></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -31,7 +31,7 @@ expressions.
|
|||||||
<li>Submitted by <a href="../../people/greg_colvin.htm">Greg Colvin</a> and <a href="../../people/beman_dawes.html">Beman
|
<li>Submitted by <a href="../../people/greg_colvin.htm">Greg Colvin</a> and <a href="../../people/beman_dawes.html">Beman
|
||||||
Dawes</a>.</li>
|
Dawes</a>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->02 Aug 2000<!--webbot bot="Timestamp" endspan i-checksum="14748" -->
|
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->10 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15233" -->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user