Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-01-01 16:36:20


Author: danieljames
Date: 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
New Revision: 42408
URL: http://svn.boost.org/trac/boost/changeset/42408

Log:
Merge.
Added:
   branches/unordered/refactor/libs/functional/
      - copied from r42403, /branches/unordered/trunk/libs/functional/
   branches/unordered/refactor/libs/functional/hash/
      - copied from r42403, /branches/unordered/trunk/libs/functional/hash/
   branches/unordered/refactor/libs/functional/hash/doc/
      - copied from r42403, /branches/unordered/trunk/libs/functional/hash/doc/
   branches/unordered/refactor/libs/functional/hash/doc/Jamfile.v2
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/Jamfile.v2
   branches/unordered/refactor/libs/functional/hash/doc/changes.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/changes.qbk
   branches/unordered/refactor/libs/functional/hash/doc/disable.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/disable.qbk
   branches/unordered/refactor/libs/functional/hash/doc/hash.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/hash.qbk
   branches/unordered/refactor/libs/functional/hash/doc/intro.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/intro.qbk
   branches/unordered/refactor/libs/functional/hash/doc/links.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/links.qbk
   branches/unordered/refactor/libs/functional/hash/doc/portability.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/portability.qbk
   branches/unordered/refactor/libs/functional/hash/doc/ref.xml
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/ref.xml
   branches/unordered/refactor/libs/functional/hash/doc/thanks.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/thanks.qbk
   branches/unordered/refactor/libs/functional/hash/doc/tutorial.qbk
      - copied unchanged from r42403, /branches/unordered/trunk/libs/functional/hash/doc/tutorial.qbk
Properties modified:
   branches/unordered/refactor/ (props changed)
Text files modified:
   branches/unordered/refactor/boost/unordered/detail/allocator.hpp | 20 ++--
   branches/unordered/refactor/boost/unordered/detail/hash_table.hpp | 189 +++++++++++++++++++++------------------
   branches/unordered/refactor/boost/unordered_map.hpp | 56 +++++-----
   branches/unordered/refactor/boost/unordered_set.hpp | 56 +++++-----
   branches/unordered/refactor/doc/Jamfile.v2 | 4
   branches/unordered/refactor/doc/src/boost.xml | 2
   branches/unordered/refactor/libs/unordered/doc/buckets.qbk | 100 +++++++++++---------
   branches/unordered/refactor/libs/unordered/doc/intro.qbk | 10 +
   branches/unordered/refactor/libs/unordered/doc/ref.xml | 2
   branches/unordered/refactor/libs/unordered/test/container/Jamfile.v2 | 2
   branches/unordered/refactor/libs/unordered/test/exception/Jamfile.v2 | 1
   branches/unordered/refactor/libs/unordered/test/helpers/generators.hpp | 2
   branches/unordered/refactor/libs/unordered/test/unordered/Jamfile.v2 | 2
   branches/unordered/refactor/libs/unordered/test/unordered/compile_tests.cpp | 2
   branches/unordered/refactor/release.sh | 1
   15 files changed, 241 insertions(+), 208 deletions(-)

Modified: branches/unordered/refactor/boost/unordered/detail/allocator.hpp
==============================================================================
--- branches/unordered/refactor/boost/unordered/detail/allocator.hpp (original)
+++ branches/unordered/refactor/boost/unordered/detail/allocator.hpp 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -61,27 +61,27 @@
         
         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
         {
- typedef typename Allocator::pointer type;
+ typedef BOOST_DEDUCED_TYPENAME Allocator::pointer type;
         };
         
         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
         {
- typedef typename Allocator::reference type;
+ typedef BOOST_DEDUCED_TYPENAME Allocator::reference type;
         };
         
         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)
@@ -121,8 +121,8 @@
         template <class Allocator>
         struct allocator_constructor
         {
- typedef typename Allocator::value_type value_type;
- typedef typename allocator_pointer<Allocator>::type pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_value_type<Allocator>::type value_type;
+ typedef BOOST_DEDUCED_TYPENAME allocator_pointer<Allocator>::type pointer;
 
             Allocator& alloc_;
             pointer ptr_;
@@ -168,7 +168,7 @@
             {
                 pointer p = ptr_;
                 constructed_ = false;
- reset(ptr_);
+ unordered_detail::reset(ptr_);
                 return p;
             }
         };
@@ -176,7 +176,7 @@
         template <class Allocator>
         struct allocator_array_constructor
         {
- typedef typename allocator_pointer<Allocator>::type pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_pointer<Allocator>::type pointer;
 
             Allocator& alloc_;
             pointer ptr_;
@@ -220,7 +220,7 @@
             pointer release()
             {
                 pointer p(ptr_);
- reset(ptr_);
+ unordered_detail::reset(ptr_);
                 return p;
             }
         private:

Modified: branches/unordered/refactor/boost/unordered/detail/hash_table.hpp
==============================================================================
--- branches/unordered/refactor/boost/unordered/detail/hash_table.hpp (original)
+++ branches/unordered/refactor/boost/unordered/detail/hash_table.hpp 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -33,15 +33,15 @@
 #include <boost/mpl/aux_/config/eti.hpp>
 
 #if BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
-#define BOOST_HASH_BORLAND_BOOL(x) (bool)(x)
+#define BOOST_UNORDERED_BORLAND_BOOL(x) (bool)(x)
 #else
-#define BOOST_HASH_BORLAND_BOOL(x) x
+#define BOOST_UNORDERED_BORLAND_BOOL(x) x
 #endif
 
 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-#define BOOST_HASH_MSVC_RESET_PTR(x) unordered_detail::reset(x)
+#define BOOST_UNORDERED_MSVC_RESET_PTR(x) unordered_detail::reset(x)
 #else
-#define BOOST_HASH_MSVC_RESET_PTR(x)
+#define BOOST_UNORDERED_MSVC_RESET_PTR(x)
 #endif
 
 namespace boost {
@@ -133,7 +133,7 @@
             // It's a sort of strict typedef.
 
             struct link_ptr {
- link_ptr() : ptr_() { BOOST_HASH_MSVC_RESET_PTR(ptr_); }
+ link_ptr() : ptr_() { BOOST_UNORDERED_MSVC_RESET_PTR(ptr_); }
                 explicit link_ptr(bucket_ptr p) : ptr_(p) {}
                 bucket_reference operator*() const { return *ptr_; }
                 bucket* operator->() const { return &*ptr_; }
@@ -152,7 +152,7 @@
 
             bucket() : next_()
             {
- BOOST_HASH_MSVC_RESET_PTR(next_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(next_);
             }
 
             bucket(bucket const& x) : next_(x.next_)
@@ -175,13 +175,13 @@
         struct node_base_equivalent_keys : bucket<Alloc>
         {
         public:
- typedef typename bucket<Alloc>::bucket_ptr bucket_ptr;
- typedef typename bucket<Alloc>::link_ptr link_ptr;
+ typedef BOOST_DEDUCED_TYPENAME bucket<Alloc>::bucket_ptr bucket_ptr;
+ typedef BOOST_DEDUCED_TYPENAME bucket<Alloc>::link_ptr link_ptr;
             typedef std::size_t size_type;
 
             node_base_equivalent_keys() : group_prev_()
             {
- BOOST_HASH_MSVC_RESET_PTR(group_prev_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(group_prev_);
             }
 
             link_ptr group_prev_;
@@ -192,13 +192,13 @@
 
             // pre: Must be pointing to the first node in a group.
             static inline link_ptr last_in_group(link_ptr n) {
- BOOST_ASSERT(BOOST_HASH_BORLAND_BOOL(n) && n != prev_in_group(n)->next_);
+ BOOST_ASSERT(BOOST_UNORDERED_BORLAND_BOOL(n) && n != prev_in_group(n)->next_);
                 return prev_in_group(n);
             }
 
             // pre: Must be pointing to the first node in a group.
             static inline link_ptr& next_group(link_ptr n) {
- BOOST_ASSERT(BOOST_HASH_BORLAND_BOOL(n) && n != prev_in_group(n)->next_);
+ BOOST_ASSERT(BOOST_UNORDERED_BORLAND_BOOL(n) && n != prev_in_group(n)->next_);
                 return prev_in_group(n)->next_;
             }
 
@@ -269,7 +269,7 @@
                     // The deleted node is the sole node in the group, so
                     // no need to unlink it from a group.
                 }
- else if(BOOST_HASH_BORLAND_BOOL(next) && prev_in_group(next) == *pos)
+ else if(BOOST_UNORDERED_BORLAND_BOOL(next) && prev_in_group(next) == *pos)
                 {
                     // The deleted node is not at the end of the group, so
                     // change the link from the next node.
@@ -314,7 +314,7 @@
                 link_ptr begin1 = split_group(split1);
                 link_ptr begin2 = split_group(split2);
 
- if(BOOST_HASH_BORLAND_BOOL(begin1) && split1 == begin2) {
+ if(BOOST_UNORDERED_BORLAND_BOOL(begin1) && split1 == begin2) {
                     link_ptr end1 = prev_in_group(begin1);
                     prev_in_group(begin1) = prev_in_group(begin2);
                     prev_in_group(begin2) = end1;
@@ -325,11 +325,11 @@
         template <class Alloc>
         struct node_base_unique_keys : bucket<Alloc>
         {
- typedef typename bucket<Alloc>::bucket_ptr bucket_ptr;
- typedef typename bucket<Alloc>::link_ptr link_ptr;
+ typedef BOOST_DEDUCED_TYPENAME bucket<Alloc>::bucket_ptr bucket_ptr;
+ typedef BOOST_DEDUCED_TYPENAME bucket<Alloc>::link_ptr link_ptr;
             typedef std::size_t size_type;
 
- link_ptr& prev_in_group(link_ptr) const {
+ static inline link_ptr& prev_in_group(link_ptr) {
                 BOOST_ASSERT(false);
             }
 
@@ -401,9 +401,9 @@
         {
         public:
             typedef bucket<Alloc> bucket;
- typedef typename bucket::bucket_allocator bucket_allocator;
- typedef typename bucket::bucket_ptr bucket_ptr;
- typedef typename bucket::link_ptr link_ptr;
+ typedef BOOST_DEDUCED_TYPENAME bucket::bucket_allocator bucket_allocator;
+ typedef BOOST_DEDUCED_TYPENAME bucket::bucket_ptr bucket_ptr;
+ typedef BOOST_DEDUCED_TYPENAME bucket::link_ptr link_ptr;
 
             struct node;
             typedef std::size_t size_type;
@@ -418,7 +418,7 @@
             typedef BOOST_DEDUCED_TYPENAME allocator_pointer<node_allocator>::type node_ptr;
             typedef BOOST_DEDUCED_TYPENAME allocator_reference<value_allocator>::type reference;
 
- typedef typename select_node_base<Alloc, EquivKeys>::type node_base;
+ typedef BOOST_DEDUCED_TYPENAME select_node_base<Alloc, EquivKeys>::type node_base;
 
             typedef BOOST_DEDUCED_TYPENAME
                 boost::unordered_detail::rebind_wrap<Alloc, node_base>::type
@@ -458,10 +458,10 @@
 
                 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)
@@ -484,7 +484,7 @@
                     : allocators_(a),
                     node_(), value_constructed_(false), node_base_constructed_(false)
                 {
- BOOST_HASH_MSVC_RESET_PTR(node_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(node_);
                 }
 
                 ~node_constructor()
@@ -570,8 +570,8 @@
                 iterator_base()
                     : bucket_(), node_()
                 {
- BOOST_HASH_MSVC_RESET_PTR(bucket_);
- BOOST_HASH_MSVC_RESET_PTR(node_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(bucket_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(node_);
                 }
 
                 explicit iterator_base(bucket_ptr b)
@@ -605,6 +605,16 @@
                         node_ = bucket_->next_;
                     }
                 }
+
+ void increment_group()
+ {
+ node_ = data::next_group(node_);
+
+ while (!node_) {
+ ++bucket_;
+ node_ = bucket_->next_;
+ }
+ }
             };
 
             // Member Variables
@@ -630,7 +640,7 @@
                 // Creates an extra bucket to act as a sentinel.
                 constructor.construct(bucket(), bucket_count_ + 1);
 
- cached_begin_bucket_ = constructor.get() + bucket_count_;
+ cached_begin_bucket_ = constructor.get() + static_cast<difference_type>(bucket_count_);
 
                 // Set up the sentinel.
                 cached_begin_bucket_->next_ = link_ptr(cached_begin_bucket_);
@@ -653,7 +663,7 @@
                 // Creates an extra bucket to act as a sentinel.
                 constructor.construct(bucket(), bucket_count_ + 1);
 
- cached_begin_bucket_ = constructor.get() + bucket_count_;
+ cached_begin_bucket_ = constructor.get() + static_cast<difference_type>(bucket_count_);
 
                 // Set up the sentinel
                 cached_begin_bucket_->next_ = link_ptr(cached_begin_bucket_);
@@ -668,15 +678,16 @@
             {
                 if(buckets_) {
                     bucket_ptr begin = cached_begin_bucket_;
- bucket_ptr end = buckets_ + bucket_count_;
+ bucket_ptr end = buckets_end();
                     while(begin != end) {
                         clear_bucket(begin);
                         ++begin;
                     }
 
                     // Destroy an extra bucket for the sentinels.
- for(size_type i2 = 0; i2 < bucket_count_ + 1; ++i2)
- allocators_.bucket_alloc_.destroy(buckets_ + i2);
+ ++end;
+ for(begin = buckets_; begin != end; ++begin)
+ allocators_.bucket_alloc_.destroy(begin);
 
                     allocators_.bucket_alloc_.deallocate(buckets_, bucket_count_ + 1);
                 }
@@ -701,15 +712,20 @@
             // Return the bucket index for a hashed value.
             //
             // no throw
- size_type index_from_hash(size_type hashed) const
+ bucket_ptr bucket_from_hash(size_type hashed) const
             {
- return hashed % bucket_count_;
+ return buckets_ + static_cast<difference_type>(hashed % bucket_count_);
             }
 
             // Begin & End
             //
             // no throw
 
+ bucket_ptr buckets_end() const
+ {
+ return buckets_ + static_cast<difference_type>(bucket_count_);
+ }
+
             iterator_base begin() const
             {
                 return size_
@@ -719,12 +735,12 @@
 
             iterator_base end() const
             {
- return iterator_base(buckets_ + bucket_count_);
+ return iterator_base(buckets_end());
             }
 
             link_ptr begin(size_type n) const
             {
- return buckets_[n].next_;
+ return (buckets_ + static_cast<difference_type>(n))->next_;
             }
 
             link_ptr end(size_type) const
@@ -743,7 +759,7 @@
             static inline size_type node_count(link_ptr it)
             {
                 size_type count = 0;
- while(BOOST_HASH_BORLAND_BOOL(it)) {
+ while(BOOST_UNORDERED_BORLAND_BOOL(it)) {
                     ++count;
                     it = it->next_;
                 }
@@ -909,7 +925,7 @@
                 link_ptr n = construct_node(v);
 
                 // Rest is no throw
- if(BOOST_HASH_BORLAND_BOOL(position))
+ if(BOOST_UNORDERED_BORLAND_BOOL(position))
                     link_node(n, position);
                 else
                     link_node_in_bucket(n, base);
@@ -970,8 +986,8 @@
 
             void clear()
             {
- bucket_ptr begin = buckets_;
- bucket_ptr end = buckets_ + bucket_count_;
+ bucket_ptr begin = cached_begin_bucket_;
+ bucket_ptr end = buckets_end();
 
                 size_ = 0;
                 cached_begin_bucket_ = end;
@@ -1019,7 +1035,8 @@
                         unlink_nodes(r1);
                         delete_to_bucket_end(r1.node_);
 
- for(bucket_ptr i = r1.bucket_ + 1; i != r2.bucket_; ++i) {
+ bucket_ptr i = r1.bucket_;
+ for(++i; i != r2.bucket_; ++i) {
                             size_ -= node_count(i->next_);
                             clear_bucket(i);
                         }
@@ -1056,7 +1073,7 @@
                         while (cached_begin_bucket_->empty())
                             ++cached_begin_bucket_;
                     } else {
- cached_begin_bucket_ = buckets_ + bucket_count_;
+ cached_begin_bucket_ = buckets_end();
                     }
                 }
             }
@@ -1068,7 +1085,7 @@
             void recompute_begin_bucket(bucket_ptr b1, bucket_ptr b2)
             {
                 BOOST_ASSERT(!(b1 < cached_begin_bucket_) && !(b2 < b1));
- BOOST_ASSERT(b2 == buckets_ + bucket_count_ || !b2->empty());
+ BOOST_ASSERT(b2 == buckets_end() || !b2->empty());
 
                 if(b1 == cached_begin_bucket_ && b1->empty())
                     cached_begin_bucket_ = b2;
@@ -1107,9 +1124,9 @@
             : public hash_table_data<Alloc, EquivKeys>
         {
             typedef hash_table_data<Alloc, EquivKeys> 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:
 
@@ -1123,6 +1140,7 @@
             typedef Pred key_equal;
             typedef ValueType value_type;
             typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
 
             // iterators
 
@@ -1386,13 +1404,13 @@
             size_type bucket(key_type const& k) const
             {
                 // hash_function can throw:
- return this->index_from_hash(hash_function()(k));
+ return hash_function()(k) % this->bucket_count_;
             }
 
             // strong safety
             bucket_ptr get_bucket(key_type const& k) const
             {
- return this->buckets_ + bucket(k);
+ return this->buckets_ + static_cast<difference_type>(bucket(k));
             }
 
             // no throw
@@ -1554,7 +1572,7 @@
                 BOOST_ASSERT(dst.size_ == 0);
                 //BOOST_ASSERT(src.allocators_.node_alloc_ == dst.allocators_.node_alloc_);
 
- bucket_ptr end = src.buckets_ + src.bucket_count_;
+ bucket_ptr end = src.buckets_end();
 
                 for(; src.cached_begin_bucket_ != end;
                         ++src.cached_begin_bucket_) {
@@ -1564,8 +1582,7 @@
                         // src_bucket to dst.
 
                         // This next line throws iff the hash function throws.
- bucket_ptr dst_bucket = dst.buckets_ +
- dst.index_from_hash(
+ bucket_ptr dst_bucket = dst.bucket_from_hash(
                                 hf(extract_key(data::get_value(src_bucket->next_))));
 
                         link_ptr n = src_bucket->next_;
@@ -1582,17 +1599,17 @@
             {
                 BOOST_ASSERT(dst.size_ == 0);
                 // no throw:
- bucket_ptr end = src.buckets_ + src.bucket_count_;
+ bucket_ptr end = src.buckets_end();
                 hasher const& hf = f.hash_function();
 
                 // no throw:
                 for(bucket_ptr i = src.cached_begin_bucket_; i != end; ++i) {
                     // no throw:
                     for(link_ptr it = src.begin(i);
- BOOST_HASH_BORLAND_BOOL(it); it = data::next_group(it)) {
+ BOOST_UNORDERED_BORLAND_BOOL(it); it = data::next_group(it)) {
                         // hash function can throw.
- bucket_ptr dst_bucket = dst.buckets_ +
- dst.index_from_hash(hf(extract_key(data::get_value(it))));
+ bucket_ptr dst_bucket = dst.bucket_from_hash(
+ hf(extract_key(data::get_value(it))));
                         // throws, strong
                         dst.copy_group(it, dst_bucket);
                     }
@@ -1614,8 +1631,7 @@
             {
                 key_type const& k = extract_key(v);
                 size_type hash_value = hash_function()(k);
- bucket_ptr bucket = this->buckets_
- + this->index_from_hash(hash_value);
+ bucket_ptr bucket = this->buckets_from_hash(hash_value);
                 link_ptr position = find_iterator(bucket, k);
 
                 // Create the node before rehashing in case it throws an
@@ -1626,7 +1642,7 @@
                 // reserve has basic exception safety if the hash function
                 // throws, strong otherwise.
                 if(reserve(size() + 1))
- bucket = this->buckets_ + this->index_from_hash(hash_value);
+ bucket = this->buckets_from_hash(hash_value);
 
                 // Nothing after the point can throw.
 
@@ -1634,7 +1650,7 @@
 
                 // I'm relying on link_ptr not being invalidated by
                 // the rehash here.
- if(BOOST_HASH_BORLAND_BOOL(position))
+ if(BOOST_UNORDERED_BORLAND_BOOL(position))
                     this->link_node(n, position);
                 else
                     this->link_node_in_bucket(n, bucket);
@@ -1706,7 +1722,7 @@
                         bucket_ptr bucket = get_bucket(k);
                         link_ptr position = find_iterator(bucket, k);
 
- if(BOOST_HASH_BORLAND_BOOL(position))
+ if(BOOST_UNORDERED_BORLAND_BOOL(position))
                             this->link_node(a.release(), position);
                         else
                             this->link_node_in_bucket(a.release(), bucket);
@@ -1746,10 +1762,10 @@
                 typedef BOOST_DEDUCED_TYPENAME value_type::second_type mapped_type;
 
                 size_type hash_value = hash_function()(k);
- bucket_ptr bucket = this->buckets_ + this->index_from_hash(hash_value);
+ bucket_ptr bucket = this->bucket_from_hash(hash_value);
                 link_ptr pos = find_iterator(bucket, k);
 
- if (BOOST_HASH_BORLAND_BOOL(pos))
+ if (BOOST_UNORDERED_BORLAND_BOOL(pos))
                     return data::get_value(pos);
                 else
                 {
@@ -1762,8 +1778,8 @@
 
                     // reserve has basic exception safety if the hash function
                     // throws, strong otherwise.
- if (reserve(size() + 1))
- bucket = this->buckets_ + this->index_from_hash(hash_value);
+ if(reserve(size() + 1))
+ bucket = this->bucket_from_hash(hash_value);
 
                     // Nothing after this point can throw.
 
@@ -1783,10 +1799,10 @@
                 // No side effects in this initial code
                 key_type const& k = extract_key(v);
                 size_type hash_value = hash_function()(k);
- bucket_ptr bucket = this->buckets_ + this->index_from_hash(hash_value);
+ bucket_ptr bucket = this->bucket_from_hash(hash_value);
                 link_ptr pos = find_iterator(bucket, k);
                 
- if (BOOST_HASH_BORLAND_BOOL(pos)) {
+ if (BOOST_UNORDERED_BORLAND_BOOL(pos)) {
                     // Found an existing key, return it (no throw).
                     return std::pair<iterator_base, bool>(
                         iterator_base(bucket, pos), false);
@@ -1803,7 +1819,7 @@
                     // reserve has basic exception safety if the hash function
                     // throws, strong otherwise.
                     if(reserve(size() + 1))
- bucket = this->buckets_ + this->index_from_hash(hash_value);
+ bucket = this->bucket_from_hash(hash_value);
 
                     // Nothing after this point can throw.
 
@@ -1859,11 +1875,10 @@
                 for (; i != j; ++i) {
                     // No side effects in this initial code
                     size_type hash_value = hash_function()(extract_key(*i));
- bucket_ptr bucket = this->buckets_
- + this->index_from_hash(hash_value);
+ bucket_ptr bucket = this->bucket_from_hash(hash_value);
                     link_ptr pos = find_iterator(bucket, extract_key(*i));
                     
- if (!BOOST_HASH_BORLAND_BOOL(pos)) {
+ if (!BOOST_UNORDERED_BORLAND_BOOL(pos)) {
                         // Doesn't already exist, add to bucket.
                         // Side effects only in this block.
 
@@ -1876,7 +1891,7 @@
                         // throws, strong otherwise.
                         if(size() + 1 >= max_load_) {
                             reserve(size() + insert_size_unique(i, j));
- bucket = this->buckets_ + this->index_from_hash(hash_value);
+ bucket = this->bucket_from_hash(hash_value);
                         }
 
                         // Nothing after this point can throw.
@@ -1918,7 +1933,7 @@
             size_type count(key_type const& k) const
             {
                 link_ptr it = find_iterator(k); // throws, strong
- return BOOST_HASH_BORLAND_BOOL(it) ? data::group_count(it) : 0;
+ return BOOST_UNORDERED_BORLAND_BOOL(it) ? data::group_count(it) : 0;
             }
 
             // find
@@ -1929,7 +1944,7 @@
                 bucket_ptr bucket = get_bucket(k);
                 link_ptr it = find_iterator(bucket, k);
 
- if (BOOST_HASH_BORLAND_BOOL(it))
+ if (BOOST_UNORDERED_BORLAND_BOOL(it))
                     return iterator_base(bucket, it);
                 else
                     return this->end();
@@ -1940,7 +1955,7 @@
                 bucket_ptr bucket = get_bucket(k);
                 link_ptr it = find_iterator(bucket, k);
 
- if (BOOST_HASH_BORLAND_BOOL(it))
+ if (BOOST_UNORDERED_BORLAND_BOOL(it))
                     return data::get_value(it);
                 else
                     throw std::out_of_range("Unable to find key in unordered_map.");
@@ -1953,10 +1968,10 @@
             {
                 bucket_ptr bucket = get_bucket(k);
                 link_ptr it = find_iterator(bucket, k);
- if (BOOST_HASH_BORLAND_BOOL(it)) {
+ if (BOOST_UNORDERED_BORLAND_BOOL(it)) {
                     iterator_base first(iterator_base(bucket, it));
- iterator_base second(iterator_base(bucket, this->last_in_group(it)));
- second.increment();
+ iterator_base second(first);
+ second.increment_group();
                     return std::pair<iterator_base, iterator_base>(first, second);
                 }
                 else {
@@ -1978,7 +1993,7 @@
 
             static inline bool group_equals(link_ptr it1, link_ptr it2, void*)
             {
- if(!BOOST_HASH_BORLAND_BOOL(it2)) return false;
+ if(!BOOST_UNORDERED_BORLAND_BOOL(it2)) return false;
                 link_ptr end1 = data::next_group(it1);
                 link_ptr end2 = data::next_group(it2);
                 do {
@@ -1996,10 +2011,10 @@
                 for(bucket_ptr i = this->cached_begin_bucket_,
                         j = this->buckets_ + this->bucket_count_; i != j; ++i)
                 {
- for(link_ptr it(i->next_); BOOST_HASH_BORLAND_BOOL(it); it = data::next_group(it))
+ for(link_ptr it(i->next_); BOOST_UNORDERED_BORLAND_BOOL(it); it = data::next_group(it))
                     {
                         link_ptr other_pos = other.find_iterator(other.extract_key(data::get_value(it)));
- if(!BOOST_HASH_BORLAND_BOOL(other_pos) ||
+ if(!BOOST_UNORDERED_BORLAND_BOOL(other_pos) ||
                             !group_equals(it, other_pos, (type_wrapper<value_type>*)0))
                             return false;
                     }
@@ -2036,7 +2051,7 @@
                 for(bucket_ptr i = this->cached_begin_bucket_,
                         j = this->buckets_ + this->bucket_count_; i != j; ++i)
                 {
- for(link_ptr it(i->next_); BOOST_HASH_BORLAND_BOOL(it); it = data::next_group(it))
+ for(link_ptr it(i->next_); BOOST_UNORDERED_BORLAND_BOOL(it); it = data::next_group(it))
                         seed ^= group_hash(it, (type_wrapper<value_type>*)0);
                 }
 
@@ -2062,7 +2077,7 @@
                     key_type const& k) const
             {
                 link_ptr it = this->begin(bucket);
- while (BOOST_HASH_BORLAND_BOOL(it) && !equal(k, data::get_value(it)))
+ while (BOOST_UNORDERED_BORLAND_BOOL(it) && !equal(k, data::get_value(it)))
                     it = data::next_group(it);
 
                 return it;
@@ -2072,7 +2087,7 @@
             link_ptr* find_for_erase(bucket_ptr bucket, key_type const& k) const
             {
                 link_ptr* it = &bucket->next_;
- while(BOOST_HASH_BORLAND_BOOL(*it) && !equal(k, data::get_value(*it)))
+ while(BOOST_UNORDERED_BORLAND_BOOL(*it) && !equal(k, data::get_value(*it)))
                     it = &data::next_group(*it);
 
                 return it;
@@ -2113,7 +2128,7 @@
 
         public:
             hash_local_iterator() : ptr_() {
- BOOST_HASH_MSVC_RESET_PTR(ptr_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(ptr_);
             }
             explicit hash_local_iterator(ptr x) : ptr_(x) {}
             BOOST_DEDUCED_TYPENAME allocator_reference<Alloc>::type operator*() const
@@ -2148,7 +2163,7 @@
 
         public:
             hash_const_local_iterator() : ptr_() {
- BOOST_HASH_MSVC_RESET_PTR(ptr_);
+ BOOST_UNORDERED_MSVC_RESET_PTR(ptr_);
             }
             explicit hash_const_local_iterator(ptr x) : ptr_(x) {}
             hash_const_local_iterator(local_iterator x) : ptr_(x.ptr_) {}
@@ -2279,7 +2294,7 @@
     } // namespace boost::unordered_detail
 } // namespace boost
 
-#undef BOOST_HASH_BORLAND_BOOL
-#undef BOOST_HASH_MSVC_RESET_PTR
+#undef BOOST_UNORDERED_BORLAND_BOOL
+#undef BOOST_UNORDERED_MSVC_RESET_PTR
 
 #endif // BOOST_UNORDERED_DETAIL_HASH_TABLE_HPP_INCLUDED

Modified: branches/unordered/refactor/boost/unordered_map.hpp
==============================================================================
--- branches/unordered/refactor/boost/unordered_map.hpp (original)
+++ branches/unordered/refactor/boost/unordered_map.hpp 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -32,7 +32,7 @@
             std::pair<const Key, T>, Key, Hash, Pred, Alloc
> implementation;
 
- typename implementation::hash_table base;
+ BOOST_DEDUCED_TYPENAME implementation::hash_table base;
 
     public:
 
@@ -45,18 +45,18 @@
         typedef Pred key_equal;
 
         typedef Alloc allocator_type;
- typedef typename allocator_type::pointer pointer;
- typedef typename allocator_type::const_pointer const_pointer;
- typedef typename allocator_type::reference reference;
- typedef typename allocator_type::const_reference const_reference;
-
- typedef typename implementation::size_type size_type;
- typedef typename implementation::difference_type difference_type;
-
- typedef typename implementation::iterator iterator;
- typedef typename implementation::const_iterator const_iterator;
- typedef typename implementation::local_iterator local_iterator;
- typedef typename implementation::const_local_iterator const_local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::pointer pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_pointer const_pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::reference reference;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_reference const_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::size_type size_type;
+ typedef BOOST_DEDUCED_TYPENAME implementation::difference_type difference_type;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::iterator iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_iterator const_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::local_iterator local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_local_iterator const_local_iterator;
 
         // construct/destroy/copy
 
@@ -90,7 +90,7 @@
 
     private:
 
- typename implementation::iterator_base const&
+ BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
             get(const_iterator const& it)
         {
             return boost::unordered_detail::iterator_access::get(it);
@@ -362,7 +362,7 @@
             std::pair<const Key, T>, Key, Hash, Pred, Alloc
> implementation;
 
- typename implementation::hash_table base;
+ BOOST_DEDUCED_TYPENAME implementation::hash_table base;
 
         public:
 
@@ -375,18 +375,18 @@
         typedef Pred key_equal;
 
         typedef Alloc allocator_type;
- typedef typename allocator_type::pointer pointer;
- typedef typename allocator_type::const_pointer const_pointer;
- typedef typename allocator_type::reference reference;
- typedef typename allocator_type::const_reference const_reference;
-
- typedef typename implementation::size_type size_type;
- typedef typename implementation::difference_type difference_type;
-
- typedef typename implementation::iterator iterator;
- typedef typename implementation::const_iterator const_iterator;
- typedef typename implementation::local_iterator local_iterator;
- typedef typename implementation::const_local_iterator const_local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::pointer pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_pointer const_pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::reference reference;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_reference const_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::size_type size_type;
+ typedef BOOST_DEDUCED_TYPENAME implementation::difference_type difference_type;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::iterator iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_iterator const_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::local_iterator local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_local_iterator const_local_iterator;
 
         // construct/destroy/copy
 
@@ -420,7 +420,7 @@
 
     private:
 
- typename implementation::iterator_base const&
+ BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
             get(const_iterator const& it)
         {
             return boost::unordered_detail::iterator_access::get(it);

Modified: branches/unordered/refactor/boost/unordered_set.hpp
==============================================================================
--- branches/unordered/refactor/boost/unordered_set.hpp (original)
+++ branches/unordered/refactor/boost/unordered_set.hpp 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -31,7 +31,7 @@
             Value, Value, Hash, Pred, Alloc
> implementation;
 
- typename implementation::hash_table base;
+ BOOST_DEDUCED_TYPENAME implementation::hash_table base;
 
     public:
 
@@ -43,18 +43,18 @@
         typedef Pred key_equal;
 
         typedef Alloc allocator_type;
- typedef typename allocator_type::pointer pointer;
- typedef typename allocator_type::const_pointer const_pointer;
- typedef typename allocator_type::reference reference;
- typedef typename allocator_type::const_reference const_reference;
-
- typedef typename implementation::size_type size_type;
- typedef typename implementation::difference_type difference_type;
-
- typedef typename implementation::const_iterator iterator;
- typedef typename implementation::const_iterator const_iterator;
- typedef typename implementation::const_local_iterator local_iterator;
- typedef typename implementation::const_local_iterator const_local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::pointer pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_pointer const_pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::reference reference;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_reference const_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::size_type size_type;
+ typedef BOOST_DEDUCED_TYPENAME implementation::difference_type difference_type;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_iterator iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_iterator const_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_local_iterator local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_local_iterator const_local_iterator;
 
         // construct/destroy/copy
 
@@ -87,7 +87,7 @@
 
     private:
 
- typename implementation::iterator_base const&
+ BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
             get(const_iterator const& it)
         {
             return boost::unordered_detail::iterator_access::get(it);
@@ -331,7 +331,7 @@
             Value, Value, Hash, Pred, Alloc
> implementation;
 
- typename implementation::hash_table base;
+ BOOST_DEDUCED_TYPENAME implementation::hash_table base;
 
     public:
 
@@ -343,18 +343,18 @@
         typedef Pred key_equal;
 
         typedef Alloc allocator_type;
- typedef typename allocator_type::pointer pointer;
- typedef typename allocator_type::const_pointer const_pointer;
- typedef typename allocator_type::reference reference;
- typedef typename allocator_type::const_reference const_reference;
-
- typedef typename implementation::size_type size_type;
- typedef typename implementation::difference_type difference_type;
-
- typedef typename implementation::const_iterator iterator;
- typedef typename implementation::const_iterator const_iterator;
- typedef typename implementation::const_local_iterator local_iterator;
- typedef typename implementation::const_local_iterator const_local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::pointer pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_pointer const_pointer;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::reference reference;
+ typedef BOOST_DEDUCED_TYPENAME allocator_type::const_reference const_reference;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::size_type size_type;
+ typedef BOOST_DEDUCED_TYPENAME implementation::difference_type difference_type;
+
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_iterator iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_iterator const_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_local_iterator local_iterator;
+ typedef BOOST_DEDUCED_TYPENAME implementation::const_local_iterator const_local_iterator;
 
         // construct/destroy/copy
 
@@ -387,7 +387,7 @@
 
     private:
 
- typename implementation::iterator_base const&
+ BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
             get(const_iterator const& it)
         {
             return boost::unordered_detail::iterator_access::get(it);

Modified: branches/unordered/refactor/doc/Jamfile.v2
==============================================================================
--- branches/unordered/refactor/doc/Jamfile.v2 (original)
+++ branches/unordered/refactor/doc/Jamfile.v2 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -8,8 +8,8 @@
 
      <dependency>../libs/unordered/doc//unordered
      <implicit-dependency>../libs/unordered/doc//unordered
- #<dependency>../libs/functional/hash/doc//hash
- #<implicit-dependency>../libs/functional/hash/doc//hash
+ <dependency>../libs/functional/hash/doc//hash
+ <implicit-dependency>../libs/functional/hash/doc//hash
 
      <xsl:param>boost.libraries=../../libs/libraries.htm
     ;

Modified: branches/unordered/refactor/doc/src/boost.xml
==============================================================================
--- branches/unordered/refactor/doc/src/boost.xml (original)
+++ branches/unordered/refactor/doc/src/boost.xml 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -5,5 +5,5 @@
   <title>The Boost C++ Unordered Containers Library Documentation</title>
 
   <xi:include href="unordered.xml"/>
- <!-- <xi:include href="hash.xml"/> -->
+ <xi:include href="hash.xml"/>
 </boostbook>

Modified: branches/unordered/refactor/libs/unordered/doc/buckets.qbk
==============================================================================
--- branches/unordered/refactor/libs/unordered/doc/buckets.qbk (original)
+++ branches/unordered/refactor/libs/unordered/doc/buckets.qbk 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -20,17 +20,16 @@
 then the number of buckets, so that container applies another transformation to
 that value to choose a bucket to place the element in.
 
-If at a later date the container wants to find an element in the container it
-just has to apply the same process to the element's key to discover which
-bucket it is in. If the hash function has worked well the elements will be
-evenly distributed amongst the buckets so it will only have to examine a small
-number of elements.
+Retreiving the elements for a given key is simple. The same process is applied
+to the key to find the correct bucket. Then the key is compared with the
+elements in the bucket to find any elements that match. If the hash
+function has worked well the elements will be evenly distributed amongst the
+buckets so only a small number of elements will need to be examined.
 
 You can see in the diagram that `A` & `D` have been placed in the same bucket.
-This means that when looking for these elements, of another element that would
-be placed in the same bucket, up to 2 comparison have to be made, making
-searching slower. This is known as a collision. To keep things fast we try to
-keep these to a minimum.
+When looking for elements in this bucket up to 2 comparisons are made, making
+the search slower. This is known as a collision. To keep things fast we try to
+keep collisions to a minimum.
 
 [table Methods for Accessing Buckets
     [[Method] [Description]]
@@ -57,6 +56,8 @@
             local_iterator end(size_type n);
             const_local_iterator begin(size_type n) const;
             const_local_iterator end(size_type n) const;
+ const_local_iterator cbegin(size_type n) const;
+ const_local_iterator cend(size_type n) const;
         ``]
         [Return begin and end iterators for bucket `n`.]
     ]
@@ -65,42 +66,31 @@
 [h2 Controlling the number of buckets]
 
 As more elements are added to an unordered associative container, the number
-of elements in the buckets will increase causing performance to get worse. To
-combat this the containers increase the bucket count as elements are inserted.
-
-The standard gives you two methods to influence the bucket count. First you can
-specify the minimum number of buckets in the constructor, and later, by calling
-`rehash`.
-
-The other method is the `max_load_factor` member function. The 'load factor'
-is the average number of elements per bucket, `max_load_factor` can be used
-to give a /hint/ of a value that the load factor should be kept below. The
-draft standard doesn't actually require the container to pay much attention
-to this value. The only time the load factor is /required/ to be less than the
-maximum is following a call to `rehash`. But most implementations will probably
-try to keep the number of elements below the max load factor, and set the
-maximum load factor something the same or near to your hint - unless your hint
-is unreasonably small.
-
-It is not specified anywhere how member functions other than `rehash` affect
-the bucket count, although `insert` is only allowed to invalidate iterators
-when the insertion causes the load factor to reach the maximum. Which will
-typically mean that insert will only change the number of buckets when an
-insert causes this.
-
-In a similar manner to using `reserve` for `vector`s, it can be a good idea
-to call `rehash` before inserting a large number of elements. This will get
-the expensive rehashing out of the way and let you store iterators, safe in
-the knowledge that they won't be invalidated. If you are inserting `n`
-elements into container `x`, you could first call:
-
- x.rehash((x.size() + n) / x.max_load_factor() + 1);
-
-[blurb Note: `rehash`'s argument is the number of buckets, not the number of
-elements, which is why the new size is divided by the maximum load factor. The
-+ 1 guarantees there is no invalidation; without it, reallocation could occur
-if the number of bucket exactly divides the target size, since the container is
-allowed to rehash when the load factor is equal to the maximum load factor.]
+of elements in the buckets will increase causing performance to degrade.
+To combat this the containers increase the bucket count as elements are inserted.
+You can also tell the container to change the bucket count (if required) by
+calling `rehash`.
+
+The standard leaves a lot of freedom to the implementor to decide how the
+number of buckets are chosen, but it does make some requirements based on the
+container's 'load factor', the average number of elements per bucket.
+Containers also have a 'maximum load factor' which they should try to keep the
+load factor below.
+
+You can't control the bucket count directly but there are two ways to
+influence it:
+
+* Specify the minimum number of buckets when constructing a container or
+ when calling `rehash`.
+* Suggest a maximum load factor by calling `max_load_factor`.
+
+`max_load_factor` doesn't let you set the maximum load factor yourself, it just
+lets you give a /hint/. And even then, the draft standard doesn't actually
+require the container to pay much attention to this value. The only time the
+load factor is /required/ to be less than the maximum is following a call to
+`rehash`. But most implementations will try to keep the number of elements
+below the max load factor, and set the maximum load factor to be the same as
+or close to the hint - unless your hint is unreasonably small or large.
 
 [table Methods for Controlling Bucket Size
     [[Method] [Description]]
@@ -125,4 +115,24 @@
 
 ]
 
+It is not specified how member functions other than `rehash` affect
+the bucket count, although `insert` is only allowed to invalidate iterators
+when the insertion causes the load factor to be greater than or equal to the
+maximum load factor. For most implementations this means that insert will only
+change the number of buckets when this happens.
+
+In a similar manner to using `reserve` for `vector`s, it can be a good idea
+to call `rehash` before inserting a large number of elements. This will get
+the expensive rehashing out of the way and let you store iterators, safe in
+the knowledge that they won't be invalidated. If you are inserting `n`
+elements into container `x`, you could first call:
+
+ x.rehash((x.size() + n) / x.max_load_factor() + 1);
+
+[blurb Note: `rehash`'s argument is the minimum number of buckets, not the
+number of elements, which is why the new size is divided by the maximum load factor. The
+`+ 1` guarantees there is no invalidation; without it, reallocation could occur
+if the number of bucket exactly divides the target size, since the container is
+allowed to rehash when the load factor is equal to the maximum load factor.]
+
 [endsect]

Modified: branches/unordered/refactor/libs/unordered/doc/intro.qbk
==============================================================================
--- branches/unordered/refactor/libs/unordered/doc/intro.qbk (original)
+++ branches/unordered/refactor/libs/unordered/doc/intro.qbk 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -28,11 +28,12 @@
 
 Also, the existing containers require a 'less than' comparison object
 to order their elements. For some data types this is impossible to implement
-or isn't practical. For a hash table you need an equality function
+or isn't practical. In contrast, a hash table only needs an equality function
 and a hash function for the key.
 
-So the __tr1__ introduced the unordered associative containers, which are
-implemented using hash tables, and they have now been added to the __draft__.
+With this in mind, the __tr1__ introduced the unordered associative containers,
+which are implemented using hash tables, and they have now been added to the
+__draft__.
 
 This library supplies an almost complete implementation of the specification in
 the __draft__, (it doesn't support `emplace` yet, see the [link
@@ -110,6 +111,7 @@
     three,3
     missing,0
 
-There are other differences, which will be detailed later.
+There are other differences, which are listed in the
+[link unordered.comparison Comparison with Associative Containers] section.
 
 [endsect]

Modified: branches/unordered/refactor/libs/unordered/doc/ref.xml
==============================================================================
--- branches/unordered/refactor/libs/unordered/doc/ref.xml (original)
+++ branches/unordered/refactor/libs/unordered/doc/ref.xml 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -1848,7 +1848,7 @@
                 <para>A reference to <code>x.second</code> where <code>x</code> is the (unique) element whose key is equivalent to <code>k</code>.</para>
               </returns>
               <throws>
- <para>An exception object of type <code>out_of_range</code> if no such element is present.</para>
+ <para>An exception object of type <code>std::out_of_range</code> if no such element is present.</para>
               </throws>
               <notes>
                 <para>This is not specified in the draft standard, but that is probably an oversight. The issue has been raised in

Modified: branches/unordered/refactor/libs/unordered/test/container/Jamfile.v2
==============================================================================
--- branches/unordered/refactor/libs/unordered/test/container/Jamfile.v2 (original)
+++ branches/unordered/refactor/libs/unordered/test/container/Jamfile.v2 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -8,6 +8,8 @@
 project unordered-test/container
     : requirements
         <toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
+ <toolset>gcc:<cxxflags>-Wsign-promo
+ <toolset>msvc:<cxxflags>/W4
     ;
 
 test-suite container-tests

Modified: branches/unordered/refactor/libs/unordered/test/exception/Jamfile.v2
==============================================================================
--- branches/unordered/refactor/libs/unordered/test/exception/Jamfile.v2 (original)
+++ branches/unordered/refactor/libs/unordered/test/exception/Jamfile.v2 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -10,6 +10,7 @@
 project unordered-test/exception-tests
     : requirements
         <toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
+ <toolset>gcc:<cxxflags>-Wsign-promo
     ;
 
 test-suite unordered-tests

Modified: branches/unordered/refactor/libs/unordered/test/helpers/generators.hpp
==============================================================================
--- branches/unordered/refactor/libs/unordered/test/helpers/generators.hpp (original)
+++ branches/unordered/refactor/libs/unordered/test/helpers/generators.hpp 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -58,7 +58,7 @@
     inline char generate(char const*)
     {
         using namespace std;
- return (rand() >> 1) % (128-32) + 32;
+ return static_cast<char>((rand() >> 1) % (128-32) + 32);
     }
 
     inline signed char generate(signed char const*)

Modified: branches/unordered/refactor/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- branches/unordered/refactor/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ branches/unordered/refactor/libs/unordered/test/unordered/Jamfile.v2 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -8,6 +8,8 @@
 project unordered-test/unordered
     : requirements
         <toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
+ <toolset>gcc:<cxxflags>-Wsign-promo
+ <toolset>msvc:<cxxflags>/W4
     ;
 
 test-suite unordered-tests

Modified: branches/unordered/refactor/libs/unordered/test/unordered/compile_tests.cpp
==============================================================================
--- branches/unordered/refactor/libs/unordered/test/unordered/compile_tests.cpp (original)
+++ branches/unordered/refactor/libs/unordered/test/unordered/compile_tests.cpp 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -59,7 +59,7 @@
 }
 
 template <class X, class Key, class T>
-void unordered_map_functions(X&, Key const& k, T const& t)
+void unordered_map_functions(X&, Key const& k, T const&)
 {
     typedef typename X::mapped_type mapped_type;
 

Modified: branches/unordered/refactor/release.sh
==============================================================================
--- branches/unordered/refactor/release.sh (original)
+++ branches/unordered/refactor/release.sh 2008-01-01 16:36:18 EST (Tue, 01 Jan 2008)
@@ -16,6 +16,7 @@
 cp $BOOST_ROOT/doc/html/*.css $UNORDERED_DST/doc/html/
 cp $BOOST_ROOT/doc/html/images/*.png $UNORDERED_DST/doc/html/images/
 
+rm -r $UNORDERED_DST/libs/functional
 rm -r $UNORDERED_DST/bin.v2
 rm $UNORDERED_DST/release.sh
 


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