Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55288 - sandbox/fmhess/boost/generic_ptr
From: fmhess_at_[hidden]
Date: 2009-07-30 14:45:30


Author: fmhess
Date: 2009-07-30 12:28:05 EDT (Thu, 30 Jul 2009)
New Revision: 55288
URL: http://svn.boost.org/trac/boost/changeset/55288

Log:
Fixed return types of monitor/intrusive casts.

Text files modified:
   sandbox/fmhess/boost/generic_ptr/intrusive.hpp | 9 ++++++---
   sandbox/fmhess/boost/generic_ptr/monitor.hpp | 8 ++++----
   2 files changed, 10 insertions(+), 7 deletions(-)

Modified: sandbox/fmhess/boost/generic_ptr/intrusive.hpp
==============================================================================
--- sandbox/fmhess/boost/generic_ptr/intrusive.hpp (original)
+++ sandbox/fmhess/boost/generic_ptr/intrusive.hpp 2009-07-30 12:28:05 EDT (Thu, 30 Jul 2009)
@@ -243,7 +243,8 @@
     return p.get();
 }
 
-template<class ToValueType, class U> intrusive<ToValueType> static_pointer_cast
+template<class ToValueType, class U>
+typename rebind<intrusive<U>, ToValueType>::other static_pointer_cast
 (
   intrusive<U> const & p,
   mpl::identity<ToValueType> to_type_iden = mpl::identity<ToValueType>()
@@ -252,7 +253,8 @@
     return static_pointer_cast(p.get(), to_type_iden);
 }
 
-template<class ToValueType, class U> intrusive<ToValueType> const_pointer_cast
+template<class ToValueType, class U>
+typename rebind<intrusive<U>, ToValueType>::other const_pointer_cast
 (
   intrusive<U> const & p,
   mpl::identity<ToValueType> to_type_iden = mpl::identity<ToValueType>()
@@ -261,7 +263,8 @@
     return const_pointer_cast(p.get(), to_type_iden);
 }
 
-template<class ToValueType, class U> intrusive<ToValueType> dynamic_pointer_cast
+template<class ToValueType, class U>
+typename rebind<intrusive<U>, ToValueType>::other dynamic_pointer_cast
 (
   intrusive<U> const & p,
   mpl::identity<ToValueType> to_type_iden = mpl::identity<ToValueType>()

Modified: sandbox/fmhess/boost/generic_ptr/monitor.hpp
==============================================================================
--- sandbox/fmhess/boost/generic_ptr/monitor.hpp (original)
+++ sandbox/fmhess/boost/generic_ptr/monitor.hpp 2009-07-30 12:28:05 EDT (Thu, 30 Jul 2009)
@@ -64,7 +64,7 @@
       monitor(): px(), _mutex_p()
       {}
       template<typename U>
- monitor( U p, const shared<Mutex*> & mutex_p = shared<Mutex*>(new Mutex()) ): px( p ), _mutex_p(mutex_p)
+ explicit monitor( U p, const shared<Mutex*> & mutex_p = shared<Mutex*>(new Mutex()) ): px( p ), _mutex_p(mutex_p)
       {}
       template<typename U>
       monitor(const monitor<U, Mutex> & other): px(other.px), _mutex_p(other._mutex_p)
@@ -142,7 +142,7 @@
 
     // casts
     template<typename ToValueType, typename U, typename Mutex>
- monitor<ToValueType, Mutex> static_pointer_cast
+ typename rebind<monitor<U, Mutex>, ToValueType>::other static_pointer_cast
     (
       monitor<U, Mutex> const & p,
       mpl::identity<ToValueType> to_type_iden = mpl::identity<ToValueType>()
@@ -151,7 +151,7 @@
         return static_pointer_cast(p.get(), to_type_iden);
     }
     template<typename ToValueType, typename U, typename Mutex>
- monitor<ToValueType, Mutex> const_pointer_cast
+ typename rebind<monitor<U, Mutex>, ToValueType>::other const_pointer_cast
     (
       monitor<U, Mutex> const & p,
       mpl::identity<ToValueType> to_type_iden = mpl::identity<ToValueType>()
@@ -160,7 +160,7 @@
         return const_pointer_cast(p.get(), to_type_iden);
     }
     template<typename ToValueType, typename U, typename Mutex>
- monitor<ToValueType, Mutex> dynamic_pointer_cast
+ typename rebind<monitor<U, Mutex>, ToValueType>::other dynamic_pointer_cast
     (
       monitor<U, Mutex> const & p,
       mpl::identity<ToValueType> to_type_iden = mpl::identity<ToValueType>()


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