From 54e12d03fdfec63b4d8ff41991c4e64af6b1b4b4 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 9 Apr 2007 16:32:45 +0000 Subject: [PATCH] Aliasing constructor added [SVN r37402] --- include/boost/shared_ptr.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index 78128e6..639066e 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -5,7 +5,7 @@ // shared_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. -// Copyright (c) 2001-2006 Peter Dimov +// Copyright (c) 2001-2007 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -195,6 +195,12 @@ public: { } + // aliasing + template< class Y > + shared_ptr( shared_ptr const & r, T * p ): px( p ), pn( r.pn ) // never throws + { + } + template shared_ptr(shared_ptr const & r, boost::detail::static_cast_tag): px(static_cast(r.px)), pn(r.pn) {