From 435c21c15512b1d5e9d712489fd9cb098463e263 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 12 Aug 2011 06:26:25 +0000 Subject: [PATCH] Unordered: Qualify calls to addressof. Hopefully this will fix C++0x compilers. Although I don't have one at hand to test. [SVN r73690] --- include/boost/unordered/detail/allocator_helpers.hpp | 9 ++++----- include/boost/unordered/detail/buckets.hpp | 11 +++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/boost/unordered/detail/allocator_helpers.hpp b/include/boost/unordered/detail/allocator_helpers.hpp index bc4367dd..8cc4f5f9 100644 --- a/include/boost/unordered/detail/allocator_helpers.hpp +++ b/include/boost/unordered/detail/allocator_helpers.hpp @@ -49,9 +49,6 @@ namespace boost { namespace unordered { namespace detail { // TODO: Use std::addressof if available? #include -namespace boost { namespace unordered { namespace detail { - using boost::addressof; -}}} namespace boost { namespace unordered { namespace detail { @@ -241,7 +238,8 @@ namespace boost { namespace unordered { namespace detail { ~allocator_array_constructor() { if (ptr_) { for(pointer p = ptr_; p != constructed_; ++p) - allocator_traits::destroy(alloc_, addressof(*p)); + allocator_traits::destroy(alloc_, + boost::addressof(*p)); allocator_traits::deallocate(alloc_, ptr_, length_); } @@ -255,7 +253,8 @@ namespace boost { namespace unordered { namespace detail { ptr_ = allocator_traits::allocate(alloc_, length_); pointer end = ptr_ + static_cast(length_); for(constructed_ = ptr_; constructed_ != end; ++constructed_) - allocator_traits::construct(alloc_, addressof(*constructed_), v); + allocator_traits::construct(alloc_, + boost::addressof(*constructed_), v); } pointer get() const diff --git a/include/boost/unordered/detail/buckets.hpp b/include/boost/unordered/detail/buckets.hpp index 7dfde3a0..21974b9f 100644 --- a/include/boost/unordered/detail/buckets.hpp +++ b/include/boost/unordered/detail/buckets.hpp @@ -195,7 +195,7 @@ namespace boost { namespace unordered { namespace detail { void delete_node(node_ptr n) { - node* raw_ptr = static_cast(addressof(*n)); + node* raw_ptr = static_cast(boost::addressof(*n)); real_node_ptr real_ptr(node_alloc().address(*raw_ptr)); ::boost::unordered::detail::destroy(raw_ptr->value_ptr()); @@ -217,7 +217,8 @@ namespace boost { namespace unordered { namespace detail { ++end; for(bucket_ptr begin = this->buckets_; begin != end; ++begin) { - allocator_traits::destroy(bucket_alloc(), addressof(*begin)); + allocator_traits::destroy(bucket_alloc(), + boost::addressof(*begin)); } allocator_traits::deallocate(bucket_alloc(), this->buckets_, this->bucket_count_ + 1); @@ -586,7 +587,8 @@ namespace boost { namespace unordered { namespace detail { } if (node_constructed_) - allocator_traits::destroy(buckets_.node_alloc(), addressof(*node_)); + allocator_traits::destroy(buckets_.node_alloc(), + boost::addressof(*node_)); allocator_traits::deallocate(buckets_.node_alloc(), node_, 1); } @@ -600,7 +602,8 @@ namespace boost { namespace unordered { namespace detail { value_constructed_ = false; node_ = allocator_traits::allocate(buckets_.node_alloc(), 1); - allocator_traits::construct(buckets_.node_alloc(), addressof(*node_), node()); + allocator_traits::construct(buckets_.node_alloc(), + boost::addressof(*node_), node()); node_->init(buckets_.bucket_alloc().address(*node_)); node_constructed_ = true;