From 88bc2e4ab3db80cb648e7c4569d89a9d894ee7b2 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 20 Dec 2007 19:12:55 +0000 Subject: [PATCH] Make some of the changes suggested by Steve Watanabe. Explicitly use unordered_detail namespace to avoid ADL. Only clear buckets starting with cached_begin_bucket_ in clear. Use BOOST_DEDUCED_TYPENAME more consistently. [SVN r42206] --- include/boost/unordered/detail/allocator.hpp | 20 +++++++++---------- .../unordered/detail/hash_table_impl.hpp | 16 +++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/boost/unordered/detail/allocator.hpp b/include/boost/unordered/detail/allocator.hpp index 671b130c..e7dd8d11 100644 --- a/include/boost/unordered/detail/allocator.hpp +++ b/include/boost/unordered/detail/allocator.hpp @@ -61,27 +61,27 @@ namespace boost { template struct allocator_value_type { - typedef typename Allocator::value_type type; + typedef BOOST_DEDUCED_TYPENAME Allocator::value_type type; }; template struct allocator_pointer { - typedef typename Allocator::pointer type; + typedef BOOST_DEDUCED_TYPENAME Allocator::pointer type; }; template struct allocator_const_pointer { - typedef typename Allocator::const_pointer type; + typedef BOOST_DEDUCED_TYPENAME Allocator::const_pointer type; }; template struct allocator_reference { - typedef typename Allocator::reference type; + typedef BOOST_DEDUCED_TYPENAME Allocator::reference type; }; template struct allocator_const_reference { - typedef typename Allocator::const_reference type; + typedef BOOST_DEDUCED_TYPENAME Allocator::const_reference type; }; #if defined(BOOST_MPL_CFG_MSVC_ETI_BUG) @@ -121,8 +121,8 @@ namespace boost { template struct allocator_constructor { - typedef typename Allocator::value_type value_type; - typedef typename allocator_pointer::type pointer; + typedef BOOST_DEDUCED_TYPENAME allocator_value_type::type value_type; + typedef BOOST_DEDUCED_TYPENAME allocator_pointer::type pointer; Allocator& alloc_; pointer ptr_; @@ -168,7 +168,7 @@ namespace boost { { pointer p = ptr_; constructed_ = false; - reset(ptr_); + unordered_detail::reset(ptr_); return p; } }; @@ -176,7 +176,7 @@ namespace boost { template struct allocator_array_constructor { - typedef typename allocator_pointer::type pointer; + typedef BOOST_DEDUCED_TYPENAME allocator_pointer::type pointer; Allocator& alloc_; pointer ptr_; @@ -220,7 +220,7 @@ namespace boost { pointer release() { pointer p(ptr_); - reset(ptr_); + unordered_detail::reset(ptr_); return p; } private: diff --git a/include/boost/unordered/detail/hash_table_impl.hpp b/include/boost/unordered/detail/hash_table_impl.hpp index 0c1c319e..00002cd0 100644 --- a/include/boost/unordered/detail/hash_table_impl.hpp +++ b/include/boost/unordered/detail/hash_table_impl.hpp @@ -154,10 +154,10 @@ namespace boost { void swap(allocators& x) { - hash_swap(node_alloc_, x.node_alloc_); - hash_swap(bucket_alloc_, x.bucket_alloc_); - hash_swap(value_alloc_, x.value_alloc_); - hash_swap(node_base_alloc_, x.node_base_alloc_); + unordered_detail::hash_swap(node_alloc_, x.node_alloc_); + unordered_detail::hash_swap(bucket_alloc_, x.bucket_alloc_); + unordered_detail::hash_swap(value_alloc_, x.value_alloc_); + unordered_detail::hash_swap(node_base_alloc_, x.node_base_alloc_); } bool operator==(allocators const& x) @@ -831,7 +831,7 @@ namespace boost { void clear() { - bucket_ptr begin = buckets_; + bucket_ptr begin = cached_begin_bucket_; bucket_ptr end = buckets_ + bucket_count_; size_ = 0; @@ -969,9 +969,9 @@ namespace boost { { typedef BOOST_UNORDERED_TABLE_DATA data; - typedef typename data::node_constructor node_constructor; - typedef typename data::bucket_ptr bucket_ptr; - typedef typename data::link_ptr link_ptr; + typedef BOOST_DEDUCED_TYPENAME data::node_constructor node_constructor; + typedef BOOST_DEDUCED_TYPENAME data::bucket_ptr bucket_ptr; + typedef BOOST_DEDUCED_TYPENAME data::link_ptr link_ptr; public: