Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54945 - sandbox/fmhess/boost/smart_ptr
From: fmhess_at_[hidden]
Date: 2009-07-14 10:59:49


Author: fmhess
Date: 2009-07-14 10:59:48 EDT (Tue, 14 Jul 2009)
New Revision: 54945
URL: http://svn.boost.org/trac/boost/changeset/54945

Log:
Simplified shared_ptr wrapper slightly.

Text files modified:
   sandbox/fmhess/boost/smart_ptr/shared_ptr.hpp | 15 +++------------
   1 files changed, 3 insertions(+), 12 deletions(-)

Modified: sandbox/fmhess/boost/smart_ptr/shared_ptr.hpp
==============================================================================
--- sandbox/fmhess/boost/smart_ptr/shared_ptr.hpp (original)
+++ sandbox/fmhess/boost/smart_ptr/shared_ptr.hpp 2009-07-14 10:59:48 EDT (Tue, 14 Jul 2009)
@@ -52,15 +52,6 @@
                 shared_ptr(shared_ptr<Y> const & r, T *p): base_type(static_cast<const generic_shared<Y*> &>(r), p)
                 {}
                 template<typename Y>
- shared_ptr(shared_ptr<Y> const & r, boost::gs_detail::static_cast_tag t): base_type(static_cast<const generic_shared<Y*> &>(r), t)
- {}
- template<typename Y>
- shared_ptr(shared_ptr<Y> const & r, boost::gs_detail::const_cast_tag t): base_type(static_cast<const generic_shared<Y*> &>(r), t)
- {}
- template<typename Y>
- shared_ptr(shared_ptr<Y> const & r, boost::gs_detail::dynamic_cast_tag t): base_type(static_cast<const generic_shared<Y*> &>(r), t)
- {}
- template<typename Y>
                 explicit shared_ptr(std::auto_ptr<Y> & r): base_type(r)
                 {}
                 template<typename Ap>
@@ -109,17 +100,17 @@
         };
         template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r)
         {
- return shared_ptr<T>(r, boost::gs_detail::static_cast_tag());
+ return shared_ptr<T>(static_pointer_cast<generic_shared<U*> const &>(r));
         }
 
         template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r)
         {
- return shared_ptr<T>(r, boost::gs_detail::const_cast_tag());
+ return shared_ptr<T>(const_pointer_cast<generic_shared<U*> const &>(r));
         }
 
         template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r)
         {
- return shared_ptr<T>(r, boost::gs_detail::dynamic_cast_tag());
+ return shared_ptr<T>(dynamic_pointer_cast<generic_shared<U*> const &>(r));
         }
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk