|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76261 - trunk/boost/interprocess/smart_ptr/detail
From: igaztanaga_at_[hidden]
Date: 2012-01-01 13:46:40
Author: igaztanaga
Date: 2012-01-01 13:46:39 EST (Sun, 01 Jan 2012)
New Revision: 76261
URL: http://svn.boost.org/trac/boost/changeset/76261
Log:
Use allocator traits instead of allocator::rebind
Text files modified:
trunk/boost/interprocess/smart_ptr/detail/shared_count.hpp | 10 +++++++---
trunk/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp | 18 +++++++++++++-----
2 files changed, 20 insertions(+), 8 deletions(-)
Modified: trunk/boost/interprocess/smart_ptr/detail/shared_count.hpp
==============================================================================
--- trunk/boost/interprocess/smart_ptr/detail/shared_count.hpp (original)
+++ trunk/boost/interprocess/smart_ptr/detail/shared_count.hpp 2012-01-01 13:46:39 EST (Sun, 01 Jan 2012)
@@ -28,6 +28,7 @@
#include <boost/interprocess/smart_ptr/detail/bad_weak_ptr.hpp>
#include <boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp>
#include <boost/interprocess/detail/utilities.hpp>
+#include <boost/container/allocator/allocator_traits.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <functional> // std::less
@@ -54,9 +55,12 @@
rebind_pointer<counted_impl>::type counted_impl_ptr;
typedef typename boost::intrusive::
pointer_traits<typename VoidAllocator::pointer>::template
- rebind_pointer<sp_counted_base>::type counted_base_ptr;
- typedef typename VoidAllocator::template rebind
- <counted_impl>::other counted_impl_allocator;
+ rebind_pointer<sp_counted_base>::type counted_base_ptr;
+
+ typedef boost::container::allocator_traits<VoidAllocator> vallocator_traits;
+
+ typedef typename vallocator_traits::template
+ portable_rebind_alloc<counted_impl>::type counted_impl_allocator;
typedef typename boost::intrusive::
pointer_traits<typename VoidAllocator::pointer>::template
Modified: trunk/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp
==============================================================================
--- trunk/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp (original)
+++ trunk/boost/interprocess/smart_ptr/detail/sp_counted_impl.hpp 2012-01-01 13:46:39 EST (Sun, 01 Jan 2012)
@@ -26,6 +26,7 @@
#include <boost/interprocess/smart_ptr/detail/sp_counted_base.hpp>
#include <boost/interprocess/smart_ptr/scoped_ptr.hpp>
#include <boost/interprocess/detail/utilities.hpp>
+#include <boost/container/allocator/allocator_traits.hpp>
#include <boost/intrusive/pointer_traits.hpp>
namespace boost {
@@ -62,18 +63,25 @@
{ if (ptr) priv_deallocate(ptr, alloc_version()); }
};
+
+
template<class A, class D>
class sp_counted_impl_pd
: public sp_counted_base
- , A::template rebind< sp_counted_impl_pd<A, D> >::other
+ , boost::container::allocator_traits<A>::template
+ portable_rebind_alloc< sp_counted_impl_pd<A, D> >::type
, D // copy constructor must not throw
{
private:
typedef sp_counted_impl_pd<A, D> this_type;
- typedef typename A::template rebind
- <this_type>::other this_allocator;
- typedef typename A::template rebind
- <const this_type>::other const_this_allocator;
+ typedef typename boost::container::
+ allocator_traits<A>::template
+ portable_rebind_alloc
+ < this_type >::type this_allocator;
+ typedef typename boost::container::
+ allocator_traits<A>::template
+ portable_rebind_alloc
+ < const this_type >::type const_this_allocator;
typedef typename this_allocator::pointer this_pointer;
sp_counted_impl_pd( sp_counted_impl_pd const & );
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