forked from boostorg/smart_ptr
Aliasing constructor added
[SVN r37402]
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
// shared_ptr.hpp
|
// shared_ptr.hpp
|
||||||
//
|
//
|
||||||
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
|
// (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
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
@ -195,6 +195,12 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// aliasing
|
||||||
|
template< class Y >
|
||||||
|
shared_ptr( shared_ptr<Y> const & r, T * p ): px( p ), pn( r.pn ) // never throws
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
shared_ptr(shared_ptr<Y> const & r, boost::detail::static_cast_tag): px(static_cast<element_type *>(r.px)), pn(r.pn)
|
shared_ptr(shared_ptr<Y> const & r, boost::detail::static_cast_tag): px(static_cast<element_type *>(r.px)), pn(r.pn)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user