Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73690 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2011-08-12 02:26:26


Author: danieljames
Date: 2011-08-12 02:26:25 EDT (Fri, 12 Aug 2011)
New Revision: 73690
URL: http://svn.boost.org/trac/boost/changeset/73690

Log:
Unordered: Qualify calls to addressof.

Hopefully this will fix C++0x compilers. Although I don't have one at
hand to test.
Text files modified:
   trunk/boost/unordered/detail/allocator_helpers.hpp | 9 ++++-----
   trunk/boost/unordered/detail/buckets.hpp | 11 +++++++----
   2 files changed, 11 insertions(+), 9 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-08-12 02:26:25 EDT (Fri, 12 Aug 2011)
@@ -49,9 +49,6 @@
 
 // TODO: Use std::addressof if available?
 #include <boost/utility/addressof.hpp>
-namespace boost { namespace unordered { namespace detail {
- using boost::addressof;
-}}}
 
 namespace boost { namespace unordered { namespace detail {
 
@@ -241,7 +238,8 @@
         ~allocator_array_constructor() {
             if (ptr_) {
                 for(pointer p = ptr_; p != constructed_; ++p)
- allocator_traits<Allocator>::destroy(alloc_, addressof(*p));
+ allocator_traits<Allocator>::destroy(alloc_,
+ boost::addressof(*p));
 
                 allocator_traits<Allocator>::deallocate(alloc_, ptr_, length_);
             }
@@ -255,7 +253,8 @@
             ptr_ = allocator_traits<Allocator>::allocate(alloc_, length_);
             pointer end = ptr_ + static_cast<std::ptrdiff_t>(length_);
             for(constructed_ = ptr_; constructed_ != end; ++constructed_)
- allocator_traits<Allocator>::construct(alloc_, addressof(*constructed_), v);
+ allocator_traits<Allocator>::construct(alloc_,
+ boost::addressof(*constructed_), v);
         }
 
         pointer get() const

Modified: trunk/boost/unordered/detail/buckets.hpp
==============================================================================
--- trunk/boost/unordered/detail/buckets.hpp (original)
+++ trunk/boost/unordered/detail/buckets.hpp 2011-08-12 02:26:25 EDT (Fri, 12 Aug 2011)
@@ -195,7 +195,7 @@
         
         void delete_node(node_ptr n)
         {
- node* raw_ptr = static_cast<node*>(addressof(*n));
+ node* raw_ptr = static_cast<node*>(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 @@
     
             ++end;
             for(bucket_ptr begin = this->buckets_; begin != end; ++begin) {
- allocator_traits<bucket_allocator>::destroy(bucket_alloc(), addressof(*begin));
+ allocator_traits<bucket_allocator>::destroy(bucket_alloc(),
+ boost::addressof(*begin));
             }
     
             allocator_traits<bucket_allocator>::deallocate(bucket_alloc(), this->buckets_, this->bucket_count_ + 1);
@@ -586,7 +587,8 @@
             }
 
             if (node_constructed_)
- allocator_traits<node_allocator>::destroy(buckets_.node_alloc(), addressof(*node_));
+ allocator_traits<node_allocator>::destroy(buckets_.node_alloc(),
+ boost::addressof(*node_));
 
             allocator_traits<node_allocator>::deallocate(buckets_.node_alloc(), node_, 1);
         }
@@ -600,7 +602,8 @@
             value_constructed_ = false;
 
             node_ = allocator_traits<node_allocator>::allocate(buckets_.node_alloc(), 1);
- allocator_traits<node_allocator>::construct(buckets_.node_alloc(), addressof(*node_), node());
+ allocator_traits<node_allocator>::construct(buckets_.node_alloc(),
+ boost::addressof(*node_), node());
             node_->init(buckets_.bucket_alloc().address(*node_));
 
             node_constructed_ = true;


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