Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74800 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2011-10-08 08:17:28


Author: danieljames
Date: 2011-10-08 08:17:27 EDT (Sat, 08 Oct 2011)
New Revision: 74800
URL: http://svn.boost.org/trac/boost/changeset/74800

Log:
Unordered: Stop using void_pointer.

Was breaking for allocators that don't have good enough support for
void_pointer. Which I suspect is pretty common.
Text files modified:
   trunk/boost/unordered/detail/allocator_helpers.hpp | 14 +++++++-------
   trunk/boost/unordered/detail/buckets.hpp | 1 -
   trunk/boost/unordered/detail/equivalent.hpp | 19 ++++++++-----------
   trunk/boost/unordered/detail/unique.hpp | 19 ++++++++-----------
   4 files changed, 23 insertions(+), 30 deletions(-)

Modified: trunk/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- trunk/boost/unordered/detail/allocator_helpers.hpp (original)
+++ trunk/boost/unordered/detail/allocator_helpers.hpp 2011-10-08 08:17:27 EDT (Sat, 08 Oct 2011)
@@ -356,13 +356,13 @@
             typename pointer_to_other<const value_type>::type)
             const_pointer;
 
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, void_pointer,
- typename pointer_to_other<void>::type)
- void_pointer;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_void_pointer,
- typename pointer_to_other<const void>::type)
- const_void_pointer;
+ //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, void_pointer,
+ // typename pointer_to_other<void>::type)
+ // void_pointer;
+ //
+ //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_void_pointer,
+ // typename pointer_to_other<const void>::type)
+ // const_void_pointer;
 
         typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, difference_type,
             std::ptrdiff_t) difference_type;

Modified: trunk/boost/unordered/detail/buckets.hpp
==============================================================================
--- trunk/boost/unordered/detail/buckets.hpp (original)
+++ trunk/boost/unordered/detail/buckets.hpp 2011-10-08 08:17:27 EDT (Sat, 08 Oct 2011)
@@ -192,7 +192,6 @@
     public:
         typedef boost::unordered::detail::allocator_traits<A> traits;
         typedef typename traits::value_type value_type;
- typedef typename traits::void_pointer void_pointer;
 
         typedef Node node;
         typedef Bucket bucket;

Modified: trunk/boost/unordered/detail/equivalent.hpp
==============================================================================
--- trunk/boost/unordered/detail/equivalent.hpp (original)
+++ trunk/boost/unordered/detail/equivalent.hpp 2011-10-08 08:17:27 EDT (Sat, 08 Oct 2011)
@@ -17,15 +17,16 @@
 
 namespace boost { namespace unordered { namespace detail {
 
- template <typename VoidPointer, typename T> struct grouped_node;
+ template <typename A, typename T> struct grouped_node;
     template <typename T> struct grouped_ptr_node;
     template <typename Types> struct grouped_table_impl;
 
- template <typename VoidPointer, typename T>
+ template <typename A, typename T>
     struct grouped_node :
         boost::unordered::detail::value_base<T>
     {
- typedef VoidPointer link_pointer;
+ typedef typename ::boost::unordered::detail::rebind_wrap<
+ A, grouped_node<A, T> >::type::pointer link_pointer;
 
         link_pointer next_;
         link_pointer group_prev_;
@@ -69,22 +70,21 @@
     // If the allocator uses raw pointers use grouped_ptr_node
     // Otherwise use grouped_node.
 
- template <typename A, typename T,
- typename VoidPointer, typename NodePtr, typename BucketPtr>
+ template <typename A, typename T, typename NodePtr, typename BucketPtr>
     struct pick_grouped_node2
     {
- typedef boost::unordered::detail::grouped_node<VoidPointer, T> node;
+ typedef boost::unordered::detail::grouped_node<A, T> node;
 
         typedef typename boost::unordered::detail::allocator_traits<
             typename boost::unordered::detail::rebind_wrap<A, node>::type
>::pointer node_pointer;
 
         typedef boost::unordered::detail::bucket<node_pointer> bucket;
- typedef VoidPointer link_pointer;
+ typedef node_pointer link_pointer;
     };
 
     template <typename A, typename T>
- struct pick_grouped_node2<A, T, void*,
+ struct pick_grouped_node2<A, T,
         boost::unordered::detail::grouped_ptr_node<T>*,
         boost::unordered::detail::ptr_bucket*>
     {
@@ -107,7 +107,6 @@
> tentative_bucket_traits;
 
         typedef pick_grouped_node2<A, T,
- typename tentative_node_traits::void_pointer,
             typename tentative_node_traits::pointer,
             typename tentative_bucket_traits::pointer> pick;
 
@@ -127,7 +126,6 @@
 
         typedef boost::unordered::detail::allocator_traits<A> traits;
         typedef typename traits::value_type value_type;
- typedef typename traits::void_pointer void_pointer;
         typedef value_type key_type;
 
         typedef boost::unordered::detail::pick_grouped_node<A, value_type> pick;
@@ -151,7 +149,6 @@
 
         typedef boost::unordered::detail::allocator_traits<A> traits;
         typedef typename traits::value_type value_type;
- typedef typename traits::void_pointer void_pointer;
 
         typedef boost::unordered::detail::pick_grouped_node<A, value_type> pick;
         typedef typename pick::node node;

Modified: trunk/boost/unordered/detail/unique.hpp
==============================================================================
--- trunk/boost/unordered/detail/unique.hpp (original)
+++ trunk/boost/unordered/detail/unique.hpp 2011-10-08 08:17:27 EDT (Sat, 08 Oct 2011)
@@ -19,15 +19,16 @@
 
 namespace boost { namespace unordered { namespace detail {
 
- template <typename VoidPointer, typename T> struct node;
+ template <typename A, typename T> struct node;
     template <typename T> struct ptr_node;
     template <typename Types> struct table_impl;
 
- template <typename VoidPointer, typename T>
+ template <typename A, typename T>
     struct node :
         boost::unordered::detail::value_base<T>
     {
- typedef VoidPointer link_pointer;
+ typedef typename ::boost::unordered::detail::rebind_wrap<
+ A, node<A, T> >::type::pointer link_pointer;
 
         link_pointer next_;
         std::size_t hash_;
@@ -65,22 +66,21 @@
     // If the allocator uses raw pointers use ptr_node
     // Otherwise use node.
 
- template <typename A, typename T,
- typename VoidPointer, typename NodePtr, typename BucketPtr>
+ template <typename A, typename T, typename NodePtr, typename BucketPtr>
     struct pick_node2
     {
- typedef boost::unordered::detail::node<VoidPointer, T> node;
+ typedef boost::unordered::detail::node<A, T> node;
 
         typedef typename boost::unordered::detail::allocator_traits<
             typename boost::unordered::detail::rebind_wrap<A, node>::type
>::pointer node_pointer;
 
         typedef boost::unordered::detail::bucket<node_pointer> bucket;
- typedef VoidPointer link_pointer;
+ typedef node_pointer link_pointer;
     };
 
     template <typename A, typename T>
- struct pick_node2<A, T, void*,
+ struct pick_node2<A, T,
         boost::unordered::detail::ptr_node<T>*,
         boost::unordered::detail::ptr_bucket*>
     {
@@ -103,7 +103,6 @@
> tentative_bucket_traits;
 
         typedef pick_node2<A, T,
- typename tentative_node_traits::void_pointer,
             typename tentative_node_traits::pointer,
             typename tentative_bucket_traits::pointer> pick;
 
@@ -123,7 +122,6 @@
 
         typedef boost::unordered::detail::allocator_traits<A> traits;
         typedef typename traits::value_type value_type;
- typedef typename traits::void_pointer void_pointer;
         typedef value_type key_type;
 
         typedef boost::unordered::detail::pick_node<A, value_type> pick;
@@ -147,7 +145,6 @@
 
         typedef boost::unordered::detail::allocator_traits<A> traits;
         typedef typename traits::value_type value_type;
- typedef typename traits::void_pointer void_pointer;
 
         typedef boost::unordered::detail::pick_node<A, value_type> pick;
         typedef typename pick::node node;


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