From 1412e40490deb3feb9c8603e0a64d466e2309f6f Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 19 Oct 2000 21:16:46 +0000 Subject: [PATCH] Make shared_ptr ctor from auto_ptr explicit. (Robert Vugts) [SVN r8012] --- include/boost/smart_ptr.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/smart_ptr.hpp b/include/boost/smart_ptr.hpp index 353e472..686df8d 100644 --- a/include/boost/smart_ptr.hpp +++ b/include/boost/smart_ptr.hpp @@ -9,6 +9,7 @@ // See http://www.boost.org for most recent version including documentation. // 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 // Exception-specification rationale. (Beman Dawes) // 22 Jun 00 Remove #if continuations to fix GCC 2.95.2 problem (Beman Dawes) @@ -140,7 +141,7 @@ template class shared_ptr { } template - shared_ptr(std::auto_ptr& r) { + explicit shared_ptr(std::auto_ptr& r) { pn = new long(1); // may throw px = r.release(); // fix: moved here to stop leak if new throws } @@ -164,7 +165,7 @@ template class shared_ptr { return *this; } #else - shared_ptr(std::auto_ptr& r) { + explicit shared_ptr(std::auto_ptr& r) { pn = new long(1); // may throw px = r.release(); // fix: moved here to stop leak if new throws }