[SVN r45068]
This commit is contained in:
Peter Dimov
2008-05-03 15:07:58 +00:00
parent 440fcb7ba0
commit 0c4aaef77c
8 changed files with 314 additions and 7 deletions
+20 -2
View File
@@ -61,13 +61,31 @@ public:
//
template<class Y>
weak_ptr(weak_ptr<Y> const & r): pn(r.pn) // never throws
#if !defined( BOOST_NO_SFINAE )
weak_ptr( weak_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
#else
weak_ptr( weak_ptr<Y> const & r )
#endif
: pn(r.pn) // never throws
{
px = r.lock().get();
}
template<class Y>
weak_ptr(shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
#if !defined( BOOST_NO_SFINAE )
weak_ptr( shared_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
#else
weak_ptr( shared_ptr<Y> const & r )
#endif
: px( r.px ), pn( r.pn ) // never throws
{
}