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]
This commit is contained in:
Daniel James
2007-12-20 19:12:55 +00:00
parent 53242796a3
commit 88bc2e4ab3
2 changed files with 18 additions and 18 deletions

View File

@@ -61,27 +61,27 @@ namespace boost {
template <class Allocator> struct allocator_value_type template <class Allocator> struct allocator_value_type
{ {
typedef typename Allocator::value_type type; typedef BOOST_DEDUCED_TYPENAME Allocator::value_type type;
}; };
template <class Allocator> struct allocator_pointer template <class Allocator> struct allocator_pointer
{ {
typedef typename Allocator::pointer type; typedef BOOST_DEDUCED_TYPENAME Allocator::pointer type;
}; };
template <class Allocator> struct allocator_const_pointer template <class Allocator> struct allocator_const_pointer
{ {
typedef typename Allocator::const_pointer type; typedef BOOST_DEDUCED_TYPENAME Allocator::const_pointer type;
}; };
template <class Allocator> struct allocator_reference template <class Allocator> struct allocator_reference
{ {
typedef typename Allocator::reference type; typedef BOOST_DEDUCED_TYPENAME Allocator::reference type;
}; };
template <class Allocator> struct allocator_const_reference template <class Allocator> 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) #if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
@@ -121,8 +121,8 @@ namespace boost {
template <class Allocator> template <class Allocator>
struct allocator_constructor struct allocator_constructor
{ {
typedef typename Allocator::value_type value_type; typedef BOOST_DEDUCED_TYPENAME allocator_value_type<Allocator>::type value_type;
typedef typename allocator_pointer<Allocator>::type pointer; typedef BOOST_DEDUCED_TYPENAME allocator_pointer<Allocator>::type pointer;
Allocator& alloc_; Allocator& alloc_;
pointer ptr_; pointer ptr_;
@@ -168,7 +168,7 @@ namespace boost {
{ {
pointer p = ptr_; pointer p = ptr_;
constructed_ = false; constructed_ = false;
reset(ptr_); unordered_detail::reset(ptr_);
return p; return p;
} }
}; };
@@ -176,7 +176,7 @@ namespace boost {
template <class Allocator> template <class Allocator>
struct allocator_array_constructor struct allocator_array_constructor
{ {
typedef typename allocator_pointer<Allocator>::type pointer; typedef BOOST_DEDUCED_TYPENAME allocator_pointer<Allocator>::type pointer;
Allocator& alloc_; Allocator& alloc_;
pointer ptr_; pointer ptr_;
@@ -220,7 +220,7 @@ namespace boost {
pointer release() pointer release()
{ {
pointer p(ptr_); pointer p(ptr_);
reset(ptr_); unordered_detail::reset(ptr_);
return p; return p;
} }
private: private:

View File

@@ -154,10 +154,10 @@ namespace boost {
void swap(allocators& x) void swap(allocators& x)
{ {
hash_swap(node_alloc_, x.node_alloc_); unordered_detail::hash_swap(node_alloc_, x.node_alloc_);
hash_swap(bucket_alloc_, x.bucket_alloc_); unordered_detail::hash_swap(bucket_alloc_, x.bucket_alloc_);
hash_swap(value_alloc_, x.value_alloc_); unordered_detail::hash_swap(value_alloc_, x.value_alloc_);
hash_swap(node_base_alloc_, x.node_base_alloc_); unordered_detail::hash_swap(node_base_alloc_, x.node_base_alloc_);
} }
bool operator==(allocators const& x) bool operator==(allocators const& x)
@@ -831,7 +831,7 @@ namespace boost {
void clear() void clear()
{ {
bucket_ptr begin = buckets_; bucket_ptr begin = cached_begin_bucket_;
bucket_ptr end = buckets_ + bucket_count_; bucket_ptr end = buckets_ + bucket_count_;
size_ = 0; size_ = 0;
@@ -969,9 +969,9 @@ namespace boost {
{ {
typedef BOOST_UNORDERED_TABLE_DATA<Alloc> data; typedef BOOST_UNORDERED_TABLE_DATA<Alloc> data;
typedef typename data::node_constructor node_constructor; typedef BOOST_DEDUCED_TYPENAME data::node_constructor node_constructor;
typedef typename data::bucket_ptr bucket_ptr; typedef BOOST_DEDUCED_TYPENAME data::bucket_ptr bucket_ptr;
typedef typename data::link_ptr link_ptr; typedef BOOST_DEDUCED_TYPENAME data::link_ptr link_ptr;
public: public: