Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-04-17 02:56:14


Author: danieljames
Date: 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
New Revision: 44485
URL: http://svn.boost.org/trac/boost/changeset/44485

Log:
Merged revisions 44049-44479 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/trunk

........
  r44057 | danieljames | 2008-04-05 17:08:23 +0100 (Sat, 05 Apr 2008) | 1 line
  
  Fix some bugs in the exception testing code.
........
  r44076 | danieljames | 2008-04-06 20:41:19 +0100 (Sun, 06 Apr 2008) | 1 line
  
  Move semantics for compilers with rvalue references.
........
  r44077 | danieljames | 2008-04-06 20:48:59 +0100 (Sun, 06 Apr 2008) | 1 line
  
  Do move assignment 'properly'.
........
  r44085 | danieljames | 2008-04-06 22:46:04 +0100 (Sun, 06 Apr 2008) | 1 line
  
  Use normal references for the move members, reset the source buckets_ pointer to stop the buckets getting deleted, and remove a superflous pointer check.
........
  r44109 | danieljames | 2008-04-07 23:49:36 +0100 (Mon, 07 Apr 2008) | 1 line
  
  Add missing tests.
........
  r44366 | danieljames | 2008-04-13 12:59:46 +0100 (Sun, 13 Apr 2008) | 1 line
  
  Avoid using rvalue references in the implementation files.
........
  r44368 | danieljames | 2008-04-13 15:13:33 +0100 (Sun, 13 Apr 2008) | 6 lines
  
  Use a cut down version of the work in progress move library to implement move
  semantics on more compilers. Unfortunately the move constructor with allocator
  isn't really practical at the moment, since in the case where the container
  can't be moved, and the allocators aren't equal it will copy the container
  twice.
........
  r44415 | danieljames | 2008-04-14 15:19:22 +0100 (Mon, 14 Apr 2008) | 1 line
  
  Merge with trunk.
........
  r44420 | danieljames | 2008-04-14 19:02:03 +0100 (Mon, 14 Apr 2008) | 1 line
  
  Use Boost.Test's minimal test library.
........
  r44458 | danieljames | 2008-04-16 18:31:35 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Pull out the buffered functions.
........
  r44459 | danieljames | 2008-04-16 18:31:45 +0100 (Wed, 16 Apr 2008) | 4 lines
  
  Inline construct_node and create_node into copy_group - these used to be used
  in the implementation of insert but aren't now because of insert's exception
  requirements, so keeping them around was just confusing.
........
  r44460 | danieljames | 2008-04-16 18:31:54 +0100 (Wed, 16 Apr 2008) | 4 lines
  
  Change link_node so that it takes a node_constructor containing a constructed
  node instead of a node - this makes the code a little cleaner and also
  simplifies exception safety.
........
  r44461 | danieljames | 2008-04-16 18:34:48 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Try to get some more tests working on Borland.
........
  r44462 | danieljames | 2008-04-16 18:34:59 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Write out the number of copies when the unnecessary copy test fails.
........
  r44463 | danieljames | 2008-04-16 18:35:11 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Explicitly name the different insert overloads.
........
  r44464 | danieljames | 2008-04-16 18:35:22 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Explicitly name the different erase overloads.
........
  r44465 | danieljames | 2008-04-16 18:35:33 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Call the erase methods in hash_table_data directly.
........
  r44466 | danieljames | 2008-04-16 18:35:44 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add compile test for get_allocator.
........
  r44467 | danieljames | 2008-04-16 18:35:56 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add C++-0x support to the test allocators.
........
  r44468 | danieljames | 2008-04-16 18:36:06 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Add a C++-0x node_constructor.
........
  r44469 | danieljames | 2008-04-16 18:36:16 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  C++-0x constructor for node.
........
  r44470 | danieljames | 2008-04-16 18:36:26 +0100 (Wed, 16 Apr 2008) | 2 lines
  
  Missing semi-colon.
........

Added:
   branches/unordered/dev/boost/unordered/detail/config.hpp
      - copied unchanged from r44470, /branches/unordered/trunk/boost/unordered/detail/config.hpp
   branches/unordered/dev/boost/unordered/detail/move.hpp
      - copied unchanged from r44470, /branches/unordered/trunk/boost/unordered/detail/move.hpp
   branches/unordered/dev/libs/unordered/test/unordered/move_tests.cpp
      - copied unchanged from r44470, /branches/unordered/trunk/libs/unordered/test/unordered/move_tests.cpp
Properties modified:
   branches/unordered/dev/ (props changed)
Text files modified:
   branches/unordered/dev/boost/unordered/detail/hash_table.hpp | 64 ++++
   branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp | 513 +++++++++++++++++++++++----------------
   branches/unordered/dev/boost/unordered_map.hpp | 87 +++++
   branches/unordered/dev/boost/unordered_set.hpp | 86 +++++
   branches/unordered/dev/libs/functional/hash/test/container_fwd_test.cpp | 2
   branches/unordered/dev/libs/functional/hash/test/hash_built_in_array_test.cpp | 16
   branches/unordered/dev/libs/functional/hash/test/hash_complex_test.cpp | 10
   branches/unordered/dev/libs/functional/hash/test/hash_custom_test.cpp | 16
   branches/unordered/dev/libs/functional/hash/test/hash_deprecated_headers.cpp | 2
   branches/unordered/dev/libs/functional/hash/test/hash_deque_test.cpp | 6
   branches/unordered/dev/libs/functional/hash/test/hash_float_test.cpp | 4
   branches/unordered/dev/libs/functional/hash/test/hash_float_test.hpp | 76 ++--
   branches/unordered/dev/libs/functional/hash/test/hash_friend_test.cpp | 16
   branches/unordered/dev/libs/functional/hash/test/hash_function_pointer_test.cpp | 32 +-
   branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_1.cpp | 18
   branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_2.cpp | 6
   branches/unordered/dev/libs/functional/hash/test/hash_global_namespace_test.cpp | 16
   branches/unordered/dev/libs/functional/hash/test/hash_list_test.cpp | 6
   branches/unordered/dev/libs/functional/hash/test/hash_long_double_test.cpp | 4
   branches/unordered/dev/libs/functional/hash/test/hash_map_test.cpp | 6
   branches/unordered/dev/libs/functional/hash/test/hash_map_test.hpp | 8
   branches/unordered/dev/libs/functional/hash/test/hash_no_ext_fail_test.cpp | 2
   branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_1.cpp | 8
   branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_2.cpp | 8
   branches/unordered/dev/libs/functional/hash/test/hash_number_test.cpp | 62 ++--
   branches/unordered/dev/libs/functional/hash/test/hash_pointer_test.cpp | 18
   branches/unordered/dev/libs/functional/hash/test/hash_range_test.cpp | 28 +-
   branches/unordered/dev/libs/functional/hash/test/hash_sequence_test.hpp | 8
   branches/unordered/dev/libs/functional/hash/test/hash_set_test.cpp | 6
   branches/unordered/dev/libs/functional/hash/test/hash_set_test.hpp | 8
   branches/unordered/dev/libs/functional/hash/test/hash_string_test.cpp | 30 +-
   branches/unordered/dev/libs/functional/hash/test/hash_value_array_test.cpp | 14
   branches/unordered/dev/libs/functional/hash/test/hash_vector_test.cpp | 6
   branches/unordered/dev/libs/functional/hash/test/link_ext_test.cpp | 4
   branches/unordered/dev/libs/functional/hash/test/link_no_ext_test.cpp | 9
   branches/unordered/dev/libs/functional/hash/test/link_test.cpp | 2
   branches/unordered/dev/libs/unordered/test/exception/erase_exception_tests.cpp | 2
   branches/unordered/dev/libs/unordered/test/exception/insert_exception_tests.cpp | 17
   branches/unordered/dev/libs/unordered/test/exception/swap_exception_tests.cpp | 4
   branches/unordered/dev/libs/unordered/test/helpers/exception_test.hpp | 13
   branches/unordered/dev/libs/unordered/test/helpers/metafunctions.hpp | 15
   branches/unordered/dev/libs/unordered/test/helpers/test.hpp | 11
   branches/unordered/dev/libs/unordered/test/helpers/tracker.hpp | 4
   branches/unordered/dev/libs/unordered/test/objects/exception.hpp | 10
   branches/unordered/dev/libs/unordered/test/objects/memory.hpp | 18
   branches/unordered/dev/libs/unordered/test/objects/minimal.hpp | 8
   branches/unordered/dev/libs/unordered/test/objects/test.hpp | 7
   branches/unordered/dev/libs/unordered/test/unordered/Jamfile.v2 | 1
   branches/unordered/dev/libs/unordered/test/unordered/assign_tests.cpp | 18
   branches/unordered/dev/libs/unordered/test/unordered/at_tests.cpp | 4
   branches/unordered/dev/libs/unordered/test/unordered/bucket_tests.cpp | 14
   branches/unordered/dev/libs/unordered/test/unordered/compile_tests.hpp | 15
   branches/unordered/dev/libs/unordered/test/unordered/constructor_tests.cpp | 122 ++++----
   branches/unordered/dev/libs/unordered/test/unordered/copy_tests.cpp | 36 +-
   branches/unordered/dev/libs/unordered/test/unordered/equality_tests.cpp | 48 +-
   branches/unordered/dev/libs/unordered/test/unordered/erase_equiv_tests.cpp | 12
   branches/unordered/dev/libs/unordered/test/unordered/erase_tests.cpp | 46 +-
   branches/unordered/dev/libs/unordered/test/unordered/find_tests.cpp | 20
   branches/unordered/dev/libs/unordered/test/unordered/insert_stable_tests.cpp | 28 +-
   branches/unordered/dev/libs/unordered/test/unordered/insert_tests.cpp | 125 ++++----
   branches/unordered/dev/libs/unordered/test/unordered/load_factor_tests.cpp | 10
   branches/unordered/dev/libs/unordered/test/unordered/rehash_tests.cpp | 12
   branches/unordered/dev/libs/unordered/test/unordered/simple_tests.cpp | 46 +-
   branches/unordered/dev/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 9
   64 files changed, 1105 insertions(+), 777 deletions(-)

Modified: branches/unordered/dev/boost/unordered/detail/hash_table.hpp
==============================================================================
--- branches/unordered/dev/boost/unordered/detail/hash_table.hpp (original)
+++ branches/unordered/dev/boost/unordered/detail/hash_table.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -121,6 +121,70 @@
         }
 #endif
 
+ struct move_tag {};
+
+ // Both hasher and key_equal's copy/assign can throw so double
+ // buffering is used to copy them.
+
+ template <typename Hash, typename Pred>
+ struct buffered_functions
+ {
+ typedef Hash hasher;
+ typedef Pred key_equal;
+
+ class functions
+ {
+ std::pair<hasher, key_equal> functions_;
+
+ public:
+
+ functions(hasher const& h, key_equal const& k)
+ : functions_(h, k) {}
+
+ hasher const& hash_function() const
+ {
+ return functions_.first;
+ }
+
+ key_equal const& key_eq() const
+ {
+ return functions_.second;
+ }
+ };
+
+ typedef functions buffered_functions::*functions_ptr;
+
+ buffered_functions(hasher const& h, key_equal const& k)
+ : func1_(h, k), func2_(h, k), func_(&buffered_functions::func1_) {}
+
+ // This copies the given function objects into the currently unused
+ // function objects and returns a pointer, that func_ can later be
+ // set to, to commit the change.
+ //
+ // Strong exception safety (since only usued function objects are
+ // changed).
+ functions_ptr buffer(buffered_functions const& x) {
+ functions_ptr ptr = func_ == &buffered_functions::func1_
+ ? &buffered_functions::func2_ : &buffered_functions::func1_;
+ this->*ptr = x.current();
+ return ptr;
+ }
+
+ void set(functions_ptr ptr) {
+ BOOST_ASSERT(ptr != func_);
+ func_ = ptr;
+ }
+
+ functions const& current() const {
+ return this->*func_;
+ }
+
+ private:
+ functions func1_;
+ functions func2_;
+ functions_ptr func_; // The currently active functions.
+ };
+
     }
 }
 

Modified: branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -108,15 +108,114 @@
             struct node : node_base
             {
             public:
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+ template <typename... Args>
+ node(Args&&... args)
+ : node_base(), value_(std::forward<Args>(args)...) {}
+#else
                 node(value_type const& v) : node_base(), value_(v) {}
+#endif
 
                 value_type value_;
             };
 
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+
+ // allocators
+ //
+ // Stores all the allocators that we're going to need.
+
+ struct allocators
+ {
+ node_allocator node_alloc_;
+ bucket_allocator bucket_alloc_;
+
+ allocators(value_allocator const& a)
+ : node_alloc_(a), bucket_alloc_(a)
+ {}
+
+ void destroy(link_ptr ptr)
+ {
+ node_ptr n(node_alloc_.address(*static_cast<node*>(&*ptr)));
+ node_alloc_.destroy(n);
+ node_alloc_.deallocate(n, 1);
+ }
+
+ void swap(allocators& x)
+ {
+ unordered_detail::hash_swap(node_alloc_, x.node_alloc_);
+ unordered_detail::hash_swap(bucket_alloc_, x.bucket_alloc_);
+ }
+
+ bool operator==(allocators const& x)
+ {
+ return node_alloc_ == x.node_alloc_;
+ }
+ };
+
             // node_constructor
             //
             // Used to construct nodes in an exception safe manner.
 
+ class node_constructor
+ {
+ allocators& allocators_;
+
+ node_ptr node_;
+ bool node_constructed_;
+
+ public:
+
+ node_constructor(allocators& a)
+ : allocators_(a),
+ node_(), node_constructed_(false)
+ {
+ }
+
+ ~node_constructor()
+ {
+ if (node_) {
+ if (node_constructed_)
+ allocators_.node_alloc_.destroy(node_);
+ allocators_.node_alloc_.deallocate(node_, 1);
+ }
+ }
+
+ template <typename... Args>
+ void construct(Args&&... args)
+ {
+ BOOST_ASSERT(!node_);
+ node_constructed_ = false;
+
+ node_ = allocators_.node_alloc_.allocate(1);
+ allocators_.node_alloc_.construct(node_, std::forward<Args>(args)...);
+ node_constructed_ = true;
+ }
+
+ node_ptr get() const
+ {
+ BOOST_ASSERT(node_);
+ return node_;
+ }
+
+ // no throw
+ link_ptr release()
+ {
+ node_ptr p = node_;
+ unordered_detail::reset(node_);
+ return link_ptr(allocators_.bucket_alloc_.address(*p));
+ }
+
+ private:
+ node_constructor(node_constructor const&);
+ node_constructor& operator=(node_constructor const&);
+ };
+#else
+
+ // allocators
+ //
+ // Stores all the allocators that we're going to need.
+
             struct allocators
             {
                 node_allocator node_alloc_;
@@ -151,6 +250,10 @@
                 }
             };
 
+ // node_constructor
+ //
+ // Used to construct nodes in an exception safe manner.
+
             class node_constructor
             {
                 allocators& allocators_;
@@ -240,6 +343,7 @@
                 node_constructor(node_constructor const&);
                 node_constructor& operator=(node_constructor const&);
             };
+#endif
 
             // Methods for navigating groups of elements with equal keys.
 
@@ -344,22 +448,8 @@
                 buckets_(), bucket_count_(next_prime(n)),
                 cached_begin_bucket_(), size_(0)
             {
- // The array constructor will clean up in the event of an
- // exception.
- allocator_array_constructor<bucket_allocator>
- constructor(allocators_.bucket_alloc_);
-
- // Creates an extra bucket to act as a sentinel.
- constructor.construct(bucket(), bucket_count_ + 1);
-
- cached_begin_bucket_ = constructor.get() + static_cast<difference_type>(bucket_count_);
-
- // Set up the sentinel.
- cached_begin_bucket_->next_ = link_ptr(cached_begin_bucket_);
-
- // Only release the buckets once everything is successfully
- // done.
- buckets_ = constructor.release();
+ BOOST_UNORDERED_MSVC_RESET_PTR(buckets_);
+ create_buckets();
             }
 
             BOOST_UNORDERED_TABLE_DATA(BOOST_UNORDERED_TABLE_DATA const& x, size_type n)
@@ -367,6 +457,44 @@
                 buckets_(), bucket_count_(next_prime(n)),
                 cached_begin_bucket_(), size_(0)
             {
+ BOOST_UNORDERED_MSVC_RESET_PTR(buckets_);
+ create_buckets();
+ }
+
+ BOOST_UNORDERED_TABLE_DATA(BOOST_UNORDERED_TABLE_DATA& x, move_tag)
+ : allocators_(x.allocators_),
+ buckets_(x.buckets_), bucket_count_(x.bucket_count_),
+ cached_begin_bucket_(x.cached_begin_bucket_), size_(x.size_)
+ {
+ unordered_detail::reset(x.buckets_);
+ }
+
+ BOOST_UNORDERED_TABLE_DATA(BOOST_UNORDERED_TABLE_DATA& x,
+ value_allocator const& a, size_type n, move_tag)
+ : allocators_(a), buckets_(), bucket_count_(),
+ cached_begin_bucket_(), size_(0)
+ {
+ if(allocators_ == x.allocators_) {
+ buckets_ = x.buckets_;
+ bucket_count_ = x.bucket_count_;
+ cached_begin_bucket_ = x.cached_begin_bucket_;
+ size_ = x.size_;
+ unordered_detail::reset(x.buckets_);
+ }
+ else {
+ BOOST_UNORDERED_MSVC_RESET_PTR(buckets_);
+ bucket_count_ = next_prime(n);
+ create_buckets();
+ }
+ }
+
+ // no throw
+ ~BOOST_UNORDERED_TABLE_DATA()
+ {
+ delete_buckets();
+ }
+
+ void create_buckets() {
                 // The array constructor will clean up in the event of an
                 // exception.
                 allocator_array_constructor<bucket_allocator>
@@ -377,7 +505,7 @@
 
                 cached_begin_bucket_ = constructor.get() + static_cast<difference_type>(bucket_count_);
 
- // Set up the sentinel
+ // Set up the sentinel.
                 cached_begin_bucket_->next_ = link_ptr(cached_begin_bucket_);
 
                 // Only release the buckets once everything is successfully
@@ -386,7 +514,7 @@
             }
 
             // no throw
- ~BOOST_UNORDERED_TABLE_DATA()
+ void delete_buckets()
             {
                 if(buckets_) {
                     bucket_ptr begin = cached_begin_bucket_;
@@ -421,6 +549,17 @@
                 std::swap(size_, other.size_);
             }
 
+ // no throw
+ void move(BOOST_UNORDERED_TABLE_DATA& other)
+ {
+ delete_buckets();
+ buckets_ = other.buckets_;
+ unordered_detail::reset(other.buckets_);
+ bucket_count_ = other.bucket_count_;
+ cached_begin_bucket_ = other.cached_begin_bucket_;
+ size_ = other.size_;
+ }
+
             // Return the bucket for a hashed value.
             //
             // no throw
@@ -546,8 +685,11 @@
             // no throw
 
 #if BOOST_UNORDERED_EQUIVALENT_KEYS
- void link_node(link_ptr n, link_ptr pos)
+ // If n points to the first node in a group, this adds it to the
+ // end of that group.
+ link_ptr link_node(node_constructor& a, link_ptr pos)
             {
+ link_ptr n = a.release();
                 node& node_ref = get_node(n);
                 node& pos_ref = get_node(pos);
                 node_ref.next_ = pos_ref.group_prev_->next_;
@@ -555,16 +697,19 @@
                 pos_ref.group_prev_->next_ = n;
                 pos_ref.group_prev_ = n;
                 ++size_;
+ return n;
             }
 
- void link_node_in_bucket(link_ptr n, bucket_ptr base)
+ link_ptr link_node_in_bucket(node_constructor& a, bucket_ptr base)
             {
+ link_ptr n = a.release();
                 node& node_ref = get_node(n);
                 node_ref.next_ = base->next_;
                 node_ref.group_prev_ = n;
                 base->next_ = n;
                 ++size_;
                 if(base < cached_begin_bucket_) cached_begin_bucket_ = base;
+ return n;
             }
 
             void link_group(link_ptr n, bucket_ptr base, size_type count)
@@ -577,7 +722,7 @@
                 if(base < cached_begin_bucket_) cached_begin_bucket_ = base;
             }
 #else
- void link_node_in_bucket(link_ptr n, bucket_ptr base)
+ void link_node(link_ptr n, bucket_ptr base)
             {
                 n->next_ = base->next_;
                 base->next_ = n;
@@ -585,9 +730,16 @@
                 if(base < cached_begin_bucket_) cached_begin_bucket_ = base;
             }
 
+ link_ptr link_node_in_bucket(node_constructor& a, bucket_ptr base)
+ {
+ link_ptr n = a.release();
+ link_node(n, base);
+ return n;
+ }
+
             void link_group(link_ptr n, bucket_ptr base, size_type)
             {
- link_node_in_bucket(n, base);
+ link_node(n, base);
             }
 #endif
 
@@ -719,69 +871,33 @@
             }
 #endif
 
- // throws, strong exception-safety:
- link_ptr construct_node(value_type const& v)
- {
- node_constructor a(allocators_);
- a.construct(v);
- return a.release();
- }
-
- // Create Node
- //
- // Create a node and add it to the buckets in the given position.
+ // copy_group
             //
- // strong exception safety.
-
- iterator_base create_node(value_type const& v, bucket_ptr base)
- {
- // throws, strong exception-safety:
- link_ptr n = construct_node(v);
-
- // Rest is no throw
- link_node_in_bucket(n, base);
- return iterator_base(base, n);
- }
+ // Basic exception safety.
+ // If it throws, it only copies some of the nodes in the group.
 
 #if BOOST_UNORDERED_EQUIVALENT_KEYS
- iterator_base create_node(value_type const& v, iterator_base position)
- {
- // throws, strong exception-safety:
- link_ptr n = construct_node(v);
-
- // Rest is no throw
- link_node(n, position.node_);
- return iterator_base(position.bucket_, n);
- }
-
- iterator_base create_node(value_type const& v,
- bucket_ptr base, link_ptr position)
+ void copy_group(link_ptr it, bucket_ptr dst)
             {
- // throws, strong exception-safety:
- link_ptr n = construct_node(v);
+ node_constructor a(allocators_);
 
- // Rest is no throw
- if(BOOST_UNORDERED_BORLAND_BOOL(position))
- link_node(n, position);
- else
- link_node_in_bucket(n, base);
+ link_ptr end = next_group(it);
 
- return iterator_base(base, n);
- }
-#endif
+ a.construct(get_value(it)); // throws
+ link_ptr n = link_node_in_bucket(a, dst);
 
-#if BOOST_UNORDERED_EQUIVALENT_KEYS
- void copy_group(link_ptr it, bucket_ptr dst)
- {
- link_ptr end = next_group(it);
- iterator_base pos = create_node(get_value(it), dst);
- for(it = it->next_; it != end; it = it->next_)
- create_node(get_value(it), pos);
+ for(it = it->next_; it != end; it = it->next_) {
+ a.construct(get_value(it)); // throws
+ link_node(a, n);
+ }
             }
 #else
             void copy_group(link_ptr it, bucket_ptr dst)
             {
- create_node(get_value(it), dst);
+ node_constructor a(allocators_);
+
+ a.construct(get_value(it)); // throws
+ link_node_in_bucket(a, dst);
             }
 #endif
 
@@ -865,7 +981,7 @@
                 return next;
             }
 
- iterator_base erase(iterator_base r1, iterator_base r2)
+ iterator_base erase_range(iterator_base r1, iterator_base r2)
             {
                 if(r1 != r2)
                 {
@@ -999,36 +1115,12 @@
 
         private:
 
- class functions
- {
- std::pair<hasher, key_equal> functions_;
-
- public:
 
- functions(hasher const& h, key_equal const& k)
- : functions_(h, k) {}
-
- hasher const& hash_function() const
- {
- return functions_.first;
- }
-
- key_equal const& key_eq() const
- {
- return functions_.second;
- }
- };
-
- // Both hasher and key_equal's copy/assign can throw so double
- // buffering is used to copy them. func_ points to the currently
- // active function objects.
-
- typedef functions BOOST_UNORDERED_TABLE::*functions_ptr;
-
- functions func1_;
- functions func2_;
- functions_ptr func_;
+ typedef boost::unordered_detail::buffered_functions<Hash, Pred> buffered_functions;
+ typedef BOOST_DEDUCED_TYPENAME buffered_functions::functions functions;
+ typedef BOOST_DEDUCED_TYPENAME buffered_functions::functions_ptr functions_ptr;
 
+ buffered_functions functions_;
             float mlf_;
             size_type max_load_;
 
@@ -1044,9 +1136,7 @@
             BOOST_UNORDERED_TABLE(size_type n,
                     hasher const& hf, key_equal const& eq,
                     value_allocator const& a)
- : func1_(hf, eq), // throws, cleans itself up
- func2_(hf, eq), // throws, cleans itself up
- func_(&BOOST_UNORDERED_TABLE::func1_), // no throw
+ : functions_(hf, eq), // throws, cleans itself up
                 mlf_(1.0f), // no throw
                 data_(n, a) // throws, cleans itself up
             {
@@ -1090,54 +1180,74 @@
             BOOST_UNORDERED_TABLE(I i, I j, size_type n,
                     hasher const& hf, key_equal const& eq,
                     value_allocator const& a)
- : func1_(hf, eq), // throws, cleans itself up
- func2_(hf, eq), // throws, cleans itself up
- func_(&BOOST_UNORDERED_TABLE::func1_), // no throw
- mlf_(1.0f), // no throw
- data_(initial_size(i, j, n), a) // throws, cleans itself up
+ : functions_(hf, eq), // throws, cleans itself up
+ mlf_(1.0f), // no throw
+ data_(initial_size(i, j, n), a) // throws, cleans itself up
             {
                 calculate_max_load(); // no throw
 
                 // This can throw, but BOOST_UNORDERED_TABLE_DATA's destructor will clean up.
- insert(i, j);
+ insert_range(i, j);
             }
 
             // Copy Construct
 
             BOOST_UNORDERED_TABLE(BOOST_UNORDERED_TABLE const& x)
- : func1_(x.current_functions()), // throws
- func2_(x.current_functions()), // throws
- func_(&BOOST_UNORDERED_TABLE::func1_), // no throw
- mlf_(x.mlf_), // no throw
- data_(x.data_, x.min_buckets_for_size(x.size())) // throws
+ : functions_(x.functions_), // throws
+ mlf_(x.mlf_), // no throw
+ data_(x.data_, x.min_buckets_for_size(x.size())) // throws
             {
                 calculate_max_load(); // no throw
 
                 // This can throw, but BOOST_UNORDERED_TABLE_DATA's destructor will clean
                 // up.
- copy_buckets(x.data_, data_, current_functions());
+ copy_buckets(x.data_, data_, functions_.current());
             }
 
             // Copy Construct with allocator
 
             BOOST_UNORDERED_TABLE(BOOST_UNORDERED_TABLE const& x,
                     value_allocator const& a)
- : func1_(x.current_functions()), // throws
- func2_(x.current_functions()), // throws
- func_(&BOOST_UNORDERED_TABLE::func1_), // no throw
- mlf_(x.mlf_), // no throw
+ : functions_(x.functions_), // throws
+ mlf_(x.mlf_), // no throw
                 data_(x.min_buckets_for_size(x.size()), a)
             {
                 calculate_max_load(); // no throw
 
                 // This can throw, but BOOST_UNORDERED_TABLE_DATA's destructor will clean
                 // up.
- copy_buckets(x.data_, data_, current_functions());
+ copy_buckets(x.data_, data_, functions_.current());
+ }
+
+ // Move Construct
+
+ BOOST_UNORDERED_TABLE(BOOST_UNORDERED_TABLE& x, move_tag m)
+ : functions_(x.functions_), // throws
+ mlf_(x.mlf_), // no throw
+ data_(x.data_, m) // throws
+ {
+ calculate_max_load(); // no throw
+ }
+
+ BOOST_UNORDERED_TABLE(BOOST_UNORDERED_TABLE& x,
+ value_allocator const& a, move_tag m)
+ : functions_(x.functions_), // throws
+ mlf_(x.mlf_), // no throw
+ data_(x.data_, a,
+ x.min_buckets_for_size(x.size()), m) // throws
+ {
+ calculate_max_load(); // no throw
+
+ if(x.data_.buckets_) {
+ // This can throw, but BOOST_UNORDERED_TABLE_DATA's destructor will clean
+ // up.
+ copy_buckets(x.data_, data_, functions_.current());
+ }
             }
 
             // Assign
             //
- // basic exception safety, if copy_functions of reserver throws
+ // basic exception safety, if buffered_functions::buffer or reserver throws
             // the container is left in a sane, empty state. If copy_buckets
             // throws the container is left with whatever was successfully
             // copied.
@@ -1147,11 +1257,12 @@
                 if(this != &x)
                 {
                     data_.clear(); // no throw
- func_ = copy_functions(x); // throws, strong
+ functions_.set(functions_.buffer(x.functions_));
+ // throws, strong
                     mlf_ = x.mlf_; // no throw
                     calculate_max_load(); // no throw
                     reserve(x.size()); // throws
- copy_buckets(x.data_, data_, current_functions()); // throws
+ copy_buckets(x.data_, data_, functions_.current()); // throws
                 }
 
                 return *this;
@@ -1173,10 +1284,11 @@
 
             void swap(BOOST_UNORDERED_TABLE& x)
             {
- // This only effects the function objects that aren't in use
- // so it is strongly exception safe, via. double buffering.
- functions_ptr new_func_this = copy_functions(x); // throws
- functions_ptr new_func_that = x.copy_functions(*this); // throws
+ // These can throw, but they only affect the function objects
+ // that aren't in use so it is strongly exception safe, via.
+ // double buffering.
+ functions_ptr new_func_this = functions_.buffer(x.functions_);
+ functions_ptr new_func_that = x.functions_.buffer(functions_);
 
                 if(data_.allocators_ == x.data_.allocators_) {
                     data_.swap(x.data_); // no throw
@@ -1186,10 +1298,10 @@
                     // which will clean up if anything throws an exception.
                     // (all can throw, but with no effect as these are new objects).
                     data new_this(data_, x.min_buckets_for_size(x.data_.size_));
- copy_buckets(x.data_, new_this, this->*new_func_this);
+ copy_buckets(x.data_, new_this, functions_.*new_func_this);
 
                     data new_that(x.data_, min_buckets_for_size(data_.size_));
- x.copy_buckets(data_, new_that, x.*new_func_that);
+ x.copy_buckets(data_, new_that, x.functions_.*new_func_that);
 
                     // Start updating the data here, no throw from now on.
                     data_.swap(new_this);
@@ -1199,56 +1311,67 @@
                 // We've made it, the rest is no throw.
                 std::swap(mlf_, x.mlf_);
 
- func_ = new_func_this;
- x.func_ = new_func_that;
+ functions_.set(new_func_this);
+ x.functions_.set(new_func_that);
 
                 calculate_max_load();
                 x.calculate_max_load();
             }
 
- private:
+ // Move
+ //
+ // ----------------------------------------------------------------
+ //
+ // Strong exception safety (might change unused function objects)
+ //
+ // Can throw if hash or predicate object's copy constructor throws
+ // or if allocators are unequal.
 
- functions const& current_functions() const
+ void move(BOOST_UNORDERED_TABLE& x)
             {
- return this->*func_;
- }
+ // This can throw, but it only affects the function objects
+ // that aren't in use so it is strongly exception safe, via.
+ // double buffering.
+ functions_ptr new_func_this = functions_.buffer(x.functions_);
 
- // This copies the given function objects into the currently unused
- // function objects and returns a pointer, that func_ can later be
- // set to, to commit the change.
- //
- // Strong exception safety (since only usued function objects are
- // changed).
- functions_ptr copy_functions(BOOST_UNORDERED_TABLE const& x)
- {
- // no throw:
- functions_ptr ptr = func_ == &BOOST_UNORDERED_TABLE::func1_
- ? &BOOST_UNORDERED_TABLE::func2_ : &BOOST_UNORDERED_TABLE::func1_;
- // throws, functions not in use, so strong
- this->*ptr = x.current_functions();
- return ptr;
- }
+ if(data_.allocators_ == x.data_.allocators_) {
+ data_.move(x.data_); // no throw
+ }
+ else {
+ // Create new buckets in separate HASH_TABLE_DATA objects
+ // which will clean up if anything throws an exception.
+ // (all can throw, but with no effect as these are new objects).
+ data new_this(data_, x.min_buckets_for_size(x.data_.size_));
+ copy_buckets(x.data_, new_this, functions_.*new_func_this);
 
- public:
+ // Start updating the data here, no throw from now on.
+ data_.move(new_this);
+ }
+
+ // We've made it, the rest is no throw.
+ mlf_ = x.mlf_;
+ functions_.set(new_func_this);
+ calculate_max_load();
+ }
 
             // accessors
 
             // no throw
- value_allocator get_allocator() const
+ node_allocator get_allocator() const
             {
- return data_.allocators_.value_alloc_;
+ return data_.allocators_.node_alloc_;
             }
 
             // no throw
             hasher const& hash_function() const
             {
- return current_functions().hash_function();
+ return functions_.current().hash_function();
             }
 
             // no throw
             key_equal const& key_eq() const
             {
- return current_functions().key_eq();
+ return functions_.current().key_eq();
             }
 
             // no throw
@@ -1521,14 +1644,14 @@
 
             // if hash function throws, basic exception safety
             // strong otherwise
- iterator_base insert(iterator_base const& it, value_type const& v)
+ iterator_base insert_hint(iterator_base const& it, value_type const& v)
             {
                 // Create the node before rehashing in case it throws an
                 // exception (need strong safety in such a case).
                 node_constructor a(data_.allocators_);
                 a.construct(v);
 
- return insert_impl(it, a);
+ return insert_hint_impl(it, a);
             }
 
 #if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
@@ -1552,14 +1675,14 @@
             // if hash function throws, basic exception safety
             // strong otherwise
             template <class... Args>
- iterator_base emplace(iterator_base const& it, Args&&... args)
+ iterator_base emplace_hint(iterator_base const& it, Args&&... args)
             {
                 // Create the node before rehashing in case it throws an
                 // exception (need strong safety in such a case).
                 node_constructor a(data_.allocators_);
                 a.construct(std::forward<Args>(args)...);
 
- return insert_impl(it, a);
+ return insert_hint_impl(it, a);
             }
 
 #endif
@@ -1576,21 +1699,16 @@
                 if(reserve(size() + 1))
                     bucket = data_.bucket_from_hash(hash_value);
 
- // Nothing after the point can throw.
-
- link_ptr n = a.release();
-
                 // I'm relying on link_ptr not being invalidated by
                 // the rehash here.
- if(BOOST_UNORDERED_BORLAND_BOOL(position))
- data_.link_node(n, position);
- else
- data_.link_node_in_bucket(n, bucket);
-
- return iterator_base(bucket, n);
+ return iterator_base(bucket,
+ (BOOST_UNORDERED_BORLAND_BOOL(position)) ?
+ data_.link_node(a, position) :
+ data_.link_node_in_bucket(a, bucket)
+ );
             }
 
- iterator_base insert_impl(iterator_base const& it, node_constructor& a)
+ iterator_base insert_hint_impl(iterator_base const& it, node_constructor& a)
             {
                 // equal can throw, but with no effects
                 if (it == data_.end() || !equal(extract_key(a.get()->value_), *it)) {
@@ -1613,10 +1731,8 @@
 
                     // Nothing after this point can throw
 
- link_ptr n = a.release();
- data_.link_node(n, start);
-
- return iterator_base(base, n);
+ return iterator_base(base,
+ data_.link_node(a, start));
                 }
             }
 
@@ -1646,9 +1762,9 @@
                         link_ptr position = find_iterator(bucket, k);
 
                         if(BOOST_UNORDERED_BORLAND_BOOL(position))
- data_.link_node(a.release(), position);
+ data_.link_node(a, position);
                         else
- data_.link_node_in_bucket(a.release(), bucket);
+ data_.link_node_in_bucket(a, bucket);
                     }
                 }
             }
@@ -1669,7 +1785,7 @@
             // if hash function throws, or inserting > 1 element, basic exception safety
             // strong otherwise
             template <typename I>
- void insert(I i, I j)
+ void insert_range(I i, I j)
             {
                 BOOST_DEDUCED_TYPENAME boost::iterator_traversal<I>::type
                     iterator_traversal_tag;
@@ -1706,10 +1822,7 @@
 
                     // Nothing after this point can throw.
 
- link_ptr n = a.release();
- data_.link_node_in_bucket(n, bucket);
-
- return data::get_value(n);
+ return data::get_value(data_.link_node_in_bucket(a, bucket));
                 }
             }
 
@@ -1746,8 +1859,7 @@
 
                     // Nothing after this point can throw.
 
- link_ptr n = a.release();
- data_.link_node_in_bucket(n, bucket);
+ link_ptr n = data_.link_node_in_bucket(a, bucket);
 
                     return std::pair<iterator_base, bool>(
                         iterator_base(bucket, n), true);
@@ -1758,7 +1870,7 @@
 
             // if hash function throws, basic exception safety
             // strong otherwise
- iterator_base insert(iterator_base const& it, value_type const& v)
+ iterator_base insert_hint(iterator_base const& it, value_type const& v)
             {
                 if(it != data_.end() && equal(extract_key(v), *it))
                     return it;
@@ -1800,8 +1912,7 @@
 
                     // Nothing after this point can throw.
 
- link_ptr n = a.release();
- data_.link_node_in_bucket(n, bucket);
+ link_ptr n = data_.link_node_in_bucket(a, bucket);
 
                     return std::pair<iterator_base, bool>(
                         iterator_base(bucket, n), true);
@@ -1813,7 +1924,7 @@
             // if hash function throws, basic exception safety
             // strong otherwise
             template<typename... Args>
- iterator_base emplace(iterator_base const& it, Args&&... args)
+ iterator_base emplace_hint(iterator_base const& it, Args&&... args)
             {
                 // List is complicated - just call the normal implementation.
                 return emplace(std::forward<Args>(args)...).first;
@@ -1845,7 +1956,7 @@
             // if hash function throws, or inserting > 1 element, basic exception safety
             // strong otherwise
             template <typename InputIterator>
- void insert(InputIterator i, InputIterator j)
+ void insert_range(InputIterator i, InputIterator j)
             {
                 node_constructor a(data_.allocators_);
 
@@ -1871,23 +1982,17 @@
                         }
 
                         // Nothing after this point can throw.
- data_.link_node_in_bucket(a.release(), bucket);
+ data_.link_node_in_bucket(a, bucket);
                     }
                 }
             }
 #endif
         public:
 
- // erase
-
- // no throw
- iterator_base erase(iterator_base const& r)
- {
- return data_.data::erase(r);
- }
+ // erase_key
 
             // strong exception safety
- size_type erase(key_type const& k)
+ size_type erase_key(key_type const& k)
             {
                 // No side effects in initial section
                 bucket_ptr bucket = get_bucket(k);
@@ -1897,12 +2002,6 @@
                 return *it ? data_.erase_group(it, bucket) : 0;
             }
 
- // no throw
- iterator_base erase(iterator_base const& r1, iterator_base const& r2)
- {
- return data_.data::erase(r1, r2);
- }
-
             // count
             //
             // strong exception safety, no side effects
@@ -1996,7 +2095,7 @@
 public:
             bool equals(BOOST_UNORDERED_TABLE const& other) const
             {
- if(this->size() != other.size()) return false;
+ if(size() != other.size()) return false;
 
                 for(bucket_ptr i = data_.cached_begin_bucket_,
                         j = data_.buckets_end(); i != j; ++i)

Modified: branches/unordered/dev/boost/unordered_map.hpp
==============================================================================
--- branches/unordered/dev/boost/unordered_map.hpp (original)
+++ branches/unordered/dev/boost/unordered_map.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -21,6 +21,10 @@
 #include <boost/unordered/detail/hash_table.hpp>
 #include <boost/unordered/detail/allocator.hpp>
 
+#if !defined(BOOST_HAS_RVALUE_REFS)
+#include <boost/unordered/detail/move.hpp>
+#endif
+
 namespace boost
 {
     template <class Key,
@@ -100,6 +104,35 @@
         {
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS)
+ unordered_map(unordered_map&& other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_map(unordered_map&& other, allocator_type const& a)
+ : base(other.base, a, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_map& operator=(unordered_map&& x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#else
+ unordered_map(boost::unordered_detail::move_from<unordered_map> other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_map& operator=(unordered_map x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#endif
+
     private:
 
         BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -177,7 +210,7 @@
         template <class... Args>
         iterator emplace(const_iterator hint, Args&&... args)
         {
- return iterator(base.emplace(get(hint), std::forward<Args>(args)...));
+ return iterator(base.emplace_hint(get(hint), std::forward<Args>(args)...));
         }
 #endif
 
@@ -189,28 +222,28 @@
 
         iterator insert(const_iterator hint, const value_type& obj)
         {
- return iterator(base.insert(get(hint), obj));
+ return iterator(base.insert_hint(get(hint), obj));
         }
 
         template <class InputIterator>
             void insert(InputIterator first, InputIterator last)
         {
- base.insert(first, last);
+ base.insert_range(first, last);
         }
 
         iterator erase(const_iterator position)
         {
- return iterator(base.erase(get(position)));
+ return iterator(base.data_.erase(get(position)));
         }
 
         size_type erase(const key_type& k)
         {
- return base.erase(k);
+ return base.erase_key(k);
         }
 
         iterator erase(const_iterator first, const_iterator last)
         {
- return iterator(base.erase(get(first), get(last)));
+ return iterator(base.data_.erase_range(get(first), get(last)));
         }
 
         void clear()
@@ -454,6 +487,36 @@
         {
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS)
+ unordered_multimap(unordered_multimap&& other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_multimap(unordered_multimap&& other, allocator_type const& a)
+ : base(other.base, a, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_multimap& operator=(unordered_multimap&& x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#else
+ unordered_multimap(boost::unordered_detail::move_from<unordered_multimap> other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_multimap& operator=(unordered_multimap x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#endif
+
+
     private:
 
         BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -530,7 +593,7 @@
         template <class... Args>
         iterator emplace(const_iterator hint, Args&&... args)
         {
- return iterator(base.emplace(get(hint), std::forward<Args>(args)...));
+ return iterator(base.emplace_hint(get(hint), std::forward<Args>(args)...));
         }
 #endif
 
@@ -541,28 +604,28 @@
 
         iterator insert(const_iterator hint, const value_type& obj)
         {
- return iterator(base.insert(get(hint), obj));
+ return iterator(base.insert_hint(get(hint), obj));
         }
 
         template <class InputIterator>
             void insert(InputIterator first, InputIterator last)
         {
- base.insert(first, last);
+ base.insert_range(first, last);
         }
 
         iterator erase(const_iterator position)
         {
- return iterator(base.erase(get(position)));
+ return iterator(base.data_.erase(get(position)));
         }
 
         size_type erase(const key_type& k)
         {
- return base.erase(k);
+ return base.erase_key(k);
         }
 
         iterator erase(const_iterator first, const_iterator last)
         {
- return iterator(base.erase(get(first), get(last)));
+ return iterator(base.data_.erase_range(get(first), get(last)));
         }
 
         void clear()

Modified: branches/unordered/dev/boost/unordered_set.hpp
==============================================================================
--- branches/unordered/dev/boost/unordered_set.hpp (original)
+++ branches/unordered/dev/boost/unordered_set.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -21,6 +21,10 @@
 #include <boost/unordered/detail/hash_table.hpp>
 #include <boost/unordered/detail/allocator.hpp>
 
+#if !defined(BOOST_HAS_RVALUE_REFS)
+#include <boost/unordered/detail/move.hpp>
+#endif
+
 namespace boost
 {
     template <class Value,
@@ -97,6 +101,35 @@
         {
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS)
+ unordered_set(unordered_set&& other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_set(unordered_set&& other, allocator_type const& a)
+ : base(other.base, a, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_set& operator=(unordered_set&& x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#else
+ unordered_set(boost::unordered_detail::move_from<unordered_set> other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_set& operator=(unordered_set x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#endif
+
     private:
 
         BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -175,7 +208,7 @@
         iterator emplace(const_iterator hint, Args&&... args)
         {
             return iterator(
- base.emplace(get(hint), std::forward<Args>(args)...));
+ base.emplace_hint(get(hint), std::forward<Args>(args)...));
         }
 #endif
 
@@ -187,28 +220,28 @@
 
         iterator insert(const_iterator hint, const value_type& obj)
         {
- return iterator(base.insert(get(hint), obj));
+ return iterator(base.insert_hint(get(hint), obj));
         }
 
         template <class InputIterator>
             void insert(InputIterator first, InputIterator last)
         {
- base.insert(first, last);
+ base.insert_range(first, last);
         }
 
         iterator erase(const_iterator position)
         {
- return iterator(base.erase(get(position)));
+ return iterator(base.data_.erase(get(position)));
         }
 
         size_type erase(const key_type& k)
         {
- return base.erase(k);
+ return base.erase_key(k);
         }
 
         iterator erase(const_iterator first, const_iterator last)
         {
- return iterator(base.erase(get(first), get(last)));
+ return iterator(base.data_.erase_range(get(first), get(last)));
         }
 
         void clear()
@@ -423,6 +456,35 @@
         {
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS)
+ unordered_multiset(unordered_multiset&& other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_multiset(unordered_multiset&& other, allocator_type const& a)
+ : base(other.base, a, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_multiset& operator=(unordered_multiset&& x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#else
+ unordered_multiset(boost::unordered_detail::move_from<unordered_multiset> other)
+ : base(other.base, boost::unordered_detail::move_tag())
+ {
+ }
+
+ unordered_multiset& operator=(unordered_multiset x)
+ {
+ base.move(x.base);
+ return *this;
+ }
+#endif
+
     private:
 
         BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -499,7 +561,7 @@
         template <class... Args>
         iterator emplace(const_iterator hint, Args&&... args)
         {
- return iterator(base.emplace(get(hint), std::forward<Args>(args)...));
+ return iterator(base.emplace_hint(get(hint), std::forward<Args>(args)...));
         }
 #endif
 
@@ -510,28 +572,28 @@
 
         iterator insert(const_iterator hint, const value_type& obj)
         {
- return iterator(base.insert(get(hint), obj));
+ return iterator(base.insert_hint(get(hint), obj));
         }
 
         template <class InputIterator>
             void insert(InputIterator first, InputIterator last)
         {
- base.insert(first, last);
+ base.insert_range(first, last);
         }
 
         iterator erase(const_iterator position)
         {
- return iterator(base.erase(get(position)));
+ return iterator(base.data_.erase(get(position)));
         }
 
         size_type erase(const key_type& k)
         {
- return base.erase(k);
+ return base.erase_key(k);
         }
 
         iterator erase(const_iterator first, const_iterator last)
         {
- return iterator(base.erase(get(first), get(last)));
+ return iterator(base.data_.erase_range(get(first), get(last)));
         }
 
         void clear()

Modified: branches/unordered/dev/libs/functional/hash/test/container_fwd_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/container_fwd_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/container_fwd_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -77,7 +77,7 @@
 #include <complex>
 #include <utility>
 
-int main()
+int main(int, char**)
 {
     std::deque<int> x1;
     std::list<std::string> x2;

Modified: branches/unordered/dev/libs/functional/hash/test/hash_built_in_array_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_built_in_array_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_built_in_array_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -37,11 +37,11 @@
     int array3[2] = {2, 3};
     HASH_NAMESPACE::hash<int[2]> hasher3;
 
- BOOST_TEST(hasher1(array1)
+ BOOST_CHECK(hasher1(array1)
             == HASH_NAMESPACE::hash_range(array1, array1 + length1));
- BOOST_TEST(hasher2(array2)
+ BOOST_CHECK(hasher2(array2)
             == HASH_NAMESPACE::hash_range(array2, array2 + length2));
- BOOST_TEST(hasher3(array3)
+ BOOST_CHECK(hasher3(array3)
             == HASH_NAMESPACE::hash_range(array3, array3 + length3));
 }
 
@@ -59,17 +59,17 @@
         HASH_NAMESPACE::hash_combine(seed1, seed2);
     }
 
- BOOST_TEST(hasher(array) == seed1);
- BOOST_TEST(hasher(array) == HASH_NAMESPACE::hash_range(array, array + 3));
+ BOOST_CHECK(hasher(array) == seed1);
+ BOOST_CHECK(hasher(array) == HASH_NAMESPACE::hash_range(array, array + 3));
 }
 
 #endif // TEST_EXTENSIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     array_int_test();
     two_dimensional_array_test();
 #endif
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_complex_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_complex_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_complex_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -41,13 +41,13 @@
 {
     HASH_NAMESPACE::hash<std::complex<T> > complex_hasher;
 
- BOOST_TEST(complex_hasher(v) == complex_hasher(v));
+ BOOST_CHECK(complex_hasher(v) == complex_hasher(v));
 
     HASH_NAMESPACE::hash<T> real_hasher;
     T real = v.real();
     T imag = v.imag();
 
- BOOST_TEST(real_hasher(real) == complex_hasher(std::complex<T>(real)));
+ BOOST_CHECK(real_hasher(real) == complex_hasher(std::complex<T>(real)));
 
     if(imag != 0 && real_hasher(real) == complex_hasher(v)) {
         std::ostringstream os;
@@ -90,7 +90,7 @@
     }
 }
 
-int main()
+int test_main(int, char**)
 {
     complex_float_tests((float*) 0);
     complex_float_tests((double*) 0);
@@ -102,7 +102,7 @@
     complex_integral_tests((unsigned int*) 0);
     complex_integral_tests((unsigned long*) 0);
 
- return boost::report_errors();
+ return 0;
 }
 
 #endif

Modified: branches/unordered/dev/libs/functional/hash/test/hash_custom_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_custom_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_custom_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -48,7 +48,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -59,13 +59,13 @@
 void custom_tests()
 {
     HASH_NAMESPACE::hash<test::custom> custom_hasher;
- BOOST_TEST(custom_hasher(10) == 100u);
+ BOOST_CHECK(custom_hasher(10) == 100u);
     test::custom x(55);
- BOOST_TEST(custom_hasher(x) == 550u);
+ BOOST_CHECK(custom_hasher(x) == 550u);
 
     {
         using namespace HASH_NAMESPACE;
- BOOST_TEST(custom_hasher(x) == hash_value(x));
+ BOOST_CHECK(custom_hasher(x) == hash_value(x));
     }
 
     std::vector<test::custom> custom_vector;
@@ -83,17 +83,17 @@
     HASH_NAMESPACE::hash_combine(seed2, 250u);
     HASH_NAMESPACE::hash_combine(seed2, 350u);
 
- BOOST_TEST(seed ==
+ BOOST_CHECK(seed ==
             HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
- BOOST_TEST(seed == seed2);
+ BOOST_CHECK(seed == seed2);
 }
 
 #endif // TEST_EXTENSIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     custom_tests();
 #endif
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_deprecated_headers.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_deprecated_headers.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_deprecated_headers.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -19,7 +19,7 @@
 
 #include <vector>
 
-int main() {
+int main(int, char**) {
     std::vector<int> v;
     boost::hash<std::vector<int> > x;
     x(v);

Modified: branches/unordered/dev/libs/functional/hash/test/hash_deque_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_deque_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_deque_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -25,11 +25,11 @@
 
 #endif // TEST_EXTENSIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     deque_tests::deque_hash_integer_tests();
 #endif
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_float_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_float_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_float_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -5,7 +5,7 @@
 
 #include "hash_float_test.hpp"
 
-int main()
+int test_main(int, char**)
 {
     std::cerr<<"Compiler: "<<BOOST_COMPILER<<"\n";
     std::cerr<<"Platform: "<<BOOST_PLATFORM<<"\n";
@@ -14,5 +14,5 @@
     float_tests("float", (float*) 0);
     float_tests("double", (double*) 0);
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_float_test.hpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_float_test.hpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_float_test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -11,7 +11,7 @@
 # include <boost/functional/hash.hpp>
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <cmath>
 #include <boost/limits.hpp>
@@ -43,11 +43,11 @@
     T zero = 0;
     T minus_zero = (T) -1 * zero;
 
- BOOST_TEST(zero == minus_zero);
- BOOST_TEST(x1(zero) == x1(minus_zero));
+ BOOST_CHECK(zero == minus_zero);
+ BOOST_CHECK(x1(zero) == x1(minus_zero));
 
- BOOST_TEST(x1(zero) == HASH_NAMESPACE::hash_value(zero));
- BOOST_TEST(x1(minus_zero) == HASH_NAMESPACE::hash_value(minus_zero));
+ BOOST_CHECK(x1(zero) == HASH_NAMESPACE::hash_value(zero));
+ BOOST_CHECK(x1(minus_zero) == HASH_NAMESPACE::hash_value(minus_zero));
 
     using namespace std;
 
@@ -65,23 +65,23 @@
         T minus_infinity2 = (T) -1. / zero;
         T minus_infinity3 = (T) 1. / minus_zero;
 
- BOOST_TEST(x1(infinity) == HASH_NAMESPACE::hash_value(infinity));
- BOOST_TEST(x1(minus_infinity)
+ BOOST_CHECK(x1(infinity) == HASH_NAMESPACE::hash_value(infinity));
+ BOOST_CHECK(x1(minus_infinity)
                 == HASH_NAMESPACE::hash_value(minus_infinity));
 
         if(infinity == infinity2)
- BOOST_TEST(x1(infinity) == x1(infinity2));
+ BOOST_CHECK(x1(infinity) == x1(infinity2));
         if(infinity == infinity3)
- BOOST_TEST(x1(infinity) == x1(infinity3));
+ BOOST_CHECK(x1(infinity) == x1(infinity3));
         if(infinity == infinity4)
- BOOST_TEST(x1(infinity) == x1(infinity4));
+ BOOST_CHECK(x1(infinity) == x1(infinity4));
 
         if(minus_infinity == minus_infinity2)
- BOOST_TEST(x1(minus_infinity) == x1(minus_infinity2));
+ BOOST_CHECK(x1(minus_infinity) == x1(minus_infinity2));
         if(minus_infinity == minus_infinity3)
- BOOST_TEST(x1(minus_infinity) == x1(minus_infinity3));
+ BOOST_CHECK(x1(minus_infinity) == x1(minus_infinity3));
 
- BOOST_TEST(infinity != minus_infinity);
+ BOOST_CHECK(infinity != minus_infinity);
 
         if(x1(infinity) == x1(minus_infinity)) {
             std::cerr<<"x1(infinity) == x1(-infinity) == "<<x1(infinity)<<"\n";
@@ -113,22 +113,22 @@
     T quarter_max = max / 4;
     T three_quarter_max = max - quarter_max;
 
- BOOST_TEST(x1(max) == HASH_NAMESPACE::hash_value(max));
- BOOST_TEST(x1(half_max) == HASH_NAMESPACE::hash_value(half_max));
- BOOST_TEST(x1(quarter_max) == HASH_NAMESPACE::hash_value(quarter_max));
- BOOST_TEST(x1(three_quarter_max) == HASH_NAMESPACE::hash_value(three_quarter_max));
+ BOOST_CHECK(x1(max) == HASH_NAMESPACE::hash_value(max));
+ BOOST_CHECK(x1(half_max) == HASH_NAMESPACE::hash_value(half_max));
+ BOOST_CHECK(x1(quarter_max) == HASH_NAMESPACE::hash_value(quarter_max));
+ BOOST_CHECK(x1(three_quarter_max) == HASH_NAMESPACE::hash_value(three_quarter_max));
 
     // The '!=' tests could legitimately fail, but with my hash it indicates a bug.
- BOOST_TEST(x1(max) == x1(max));
- BOOST_TEST(x1(max) != x1(quarter_max));
- BOOST_TEST(x1(max) != x1(half_max));
- BOOST_TEST(x1(max) != x1(three_quarter_max));
- BOOST_TEST(x1(quarter_max) == x1(quarter_max));
- BOOST_TEST(x1(quarter_max) != x1(half_max));
- BOOST_TEST(x1(quarter_max) != x1(three_quarter_max));
- BOOST_TEST(x1(half_max) == x1(half_max));
- BOOST_TEST(x1(half_max) != x1(three_quarter_max));
- BOOST_TEST(x1(three_quarter_max) == x1(three_quarter_max));
+ BOOST_CHECK(x1(max) == x1(max));
+ BOOST_CHECK(x1(max) != x1(quarter_max));
+ BOOST_CHECK(x1(max) != x1(half_max));
+ BOOST_CHECK(x1(max) != x1(three_quarter_max));
+ BOOST_CHECK(x1(quarter_max) == x1(quarter_max));
+ BOOST_CHECK(x1(quarter_max) != x1(half_max));
+ BOOST_CHECK(x1(quarter_max) != x1(three_quarter_max));
+ BOOST_CHECK(x1(half_max) == x1(half_max));
+ BOOST_CHECK(x1(half_max) != x1(three_quarter_max));
+ BOOST_CHECK(x1(three_quarter_max) == x1(three_quarter_max));
 
 // Intel with gcc stdlib sometimes segfaults on calls to asin and acos.
 #if !((defined(__INTEL_COMPILER) || defined(__ICL) || \
@@ -137,35 +137,35 @@
     T v1 = asin((T) 1);
     T v2 = acos((T) 0);
     if(v1 == v2)
- BOOST_TEST(x1(v1) == x1(v2));
- BOOST_TEST(x1(v1) == HASH_NAMESPACE::hash_value(v1));
- BOOST_TEST(x1(v2) == HASH_NAMESPACE::hash_value(v2));
+ BOOST_CHECK(x1(v1) == x1(v2));
+ BOOST_CHECK(x1(v1) == HASH_NAMESPACE::hash_value(v1));
+ BOOST_CHECK(x1(v2) == HASH_NAMESPACE::hash_value(v2));
 #endif
 
- BOOST_TEST(x1(boost::hash_detail::limits<T>::epsilon()) ==
+ BOOST_CHECK(x1(boost::hash_detail::limits<T>::epsilon()) ==
             HASH_NAMESPACE::hash_value(boost::hash_detail::limits<T>::epsilon()));
 
- BOOST_TEST(boost::hash_detail::limits<T>::epsilon() != (T) 0);
+ BOOST_CHECK(boost::hash_detail::limits<T>::epsilon() != (T) 0);
     if(x1(boost::hash_detail::limits<T>::epsilon()) == x1((T) 0))
         std::cerr<<"x1(epsilon) == x1(0) == "<<x1((T) 0)<<"\n";
 
- BOOST_TEST(-boost::hash_detail::limits<T>::epsilon() != (T) 0);
+ BOOST_CHECK(-boost::hash_detail::limits<T>::epsilon() != (T) 0);
     if(x1(-boost::hash_detail::limits<T>::epsilon()) == x1((T) 0))
         std::cerr<<"x1(-epsilon) == x1(0) == "<<x1((T) 0)<<"\n";
 
- BOOST_TEST((T) 1 + boost::hash_detail::limits<T>::epsilon() != (T) 1);
+ BOOST_CHECK((T) 1 + boost::hash_detail::limits<T>::epsilon() != (T) 1);
     if(x1((T) 1 + boost::hash_detail::limits<T>::epsilon()) == x1((T) 1))
         std::cerr<<"x1(1 + epsilon) == x1(1) == "<<x1((T) 1)<<"\n";
 
- BOOST_TEST((T) 1 - boost::hash_detail::limits<T>::epsilon() != (T) 1);
+ BOOST_CHECK((T) 1 - boost::hash_detail::limits<T>::epsilon() != (T) 1);
     if(x1((T) 1 - boost::hash_detail::limits<T>::epsilon()) == x1((T) 1))
         std::cerr<<"x1(1 - epsilon) == x1(1) == "<<x1((T) 1)<<"\n";
 
- BOOST_TEST((T) -1 + boost::hash_detail::limits<T>::epsilon() != (T) -1);
+ BOOST_CHECK((T) -1 + boost::hash_detail::limits<T>::epsilon() != (T) -1);
     if(x1((T) -1 + boost::hash_detail::limits<T>::epsilon()) == x1((T) -1))
         std::cerr<<"x1(-1 + epsilon) == x1(-1) == "<<x1((T) -1)<<"\n";
 
- BOOST_TEST((T) -1 - boost::hash_detail::limits<T>::epsilon() != (T) -1);
+ BOOST_CHECK((T) -1 - boost::hash_detail::limits<T>::epsilon() != (T) -1);
     if(x1((T) -1 - boost::hash_detail::limits<T>::epsilon()) == x1((T) -1))
         std::cerr<<"x1(-1 - epsilon) == x1(-1) == "<<x1((T) -1)<<"\n";
 
@@ -197,7 +197,7 @@
         if(x1(boost::hash_detail::limits<T>::quiet_NaN()) == x1(1.0)) {
             std::cerr<<"x1(quiet_NaN) == x1(1.0) == "<<x1(1.0)<<"\n";
         }
- BOOST_TEST(x1(boost::hash_detail::limits<T>::quiet_NaN()) ==
+ BOOST_CHECK(x1(boost::hash_detail::limits<T>::quiet_NaN()) ==
             HASH_NAMESPACE::hash_value(boost::hash_detail::limits<T>::quiet_NaN()));
     }
 #endif

Modified: branches/unordered/dev/libs/functional/hash/test/hash_friend_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_friend_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_friend_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -50,7 +50,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -61,13 +61,13 @@
 void custom_tests()
 {
     HASH_NAMESPACE::hash<test::custom<int> > custom_hasher;
- BOOST_TEST(custom_hasher(10) == 100u);
+ BOOST_CHECK(custom_hasher(10) == 100u);
     test::custom<int> x(55);
- BOOST_TEST(custom_hasher(x) == 550u);
+ BOOST_CHECK(custom_hasher(x) == 550u);
 
     {
         using namespace HASH_NAMESPACE;
- BOOST_TEST(custom_hasher(x) == hash_value(x));
+ BOOST_CHECK(custom_hasher(x) == hash_value(x));
     }
 
     std::vector<test::custom<int> > custom_vector;
@@ -85,17 +85,17 @@
     HASH_NAMESPACE::hash_combine(seed2, 250u);
     HASH_NAMESPACE::hash_combine(seed2, 350u);
 
- BOOST_TEST(seed ==
+ BOOST_CHECK(seed ==
             HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
- BOOST_TEST(seed == seed2);
+ BOOST_CHECK(seed == seed2);
 }
 
 #endif // TEST_EXTENSIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     custom_tests();
 #endif
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_function_pointer_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_function_pointer_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_function_pointer_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -11,7 +11,7 @@
 # include <boost/functional/hash.hpp>
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <boost/limits.hpp>
 #include <boost/mpl/assert.hpp>
@@ -32,31 +32,31 @@
     HASH_NAMESPACE::hash<void(*)()> hasher_void;
     HASH_NAMESPACE::hash<int(*)(int)> hasher_int;
 
- BOOST_TEST(&void_func1 != &void_func2);
- BOOST_TEST(&int_func1 != &int_func2);
+ BOOST_CHECK(&void_func1 != &void_func2);
+ BOOST_CHECK(&int_func1 != &int_func2);
 
- BOOST_TEST(hasher_void(0) == hasher_void(0));
- BOOST_TEST(hasher_void(&void_func1) == hasher_void(&void_func1));
- BOOST_TEST(hasher_void(&void_func1) != hasher_void(&void_func2));
- BOOST_TEST(hasher_void(&void_func1) != hasher_void(0));
- BOOST_TEST(hasher_int(0) == hasher_int(0));
- BOOST_TEST(hasher_int(&int_func1) == hasher_int(&int_func1));
- BOOST_TEST(hasher_int(&int_func1) != hasher_int(&int_func2));
- BOOST_TEST(hasher_int(&int_func1) != hasher_int(0));
+ BOOST_CHECK(hasher_void(0) == hasher_void(0));
+ BOOST_CHECK(hasher_void(&void_func1) == hasher_void(&void_func1));
+ BOOST_CHECK(hasher_void(&void_func1) != hasher_void(&void_func2));
+ BOOST_CHECK(hasher_void(&void_func1) != hasher_void(0));
+ BOOST_CHECK(hasher_int(0) == hasher_int(0));
+ BOOST_CHECK(hasher_int(&int_func1) == hasher_int(&int_func1));
+ BOOST_CHECK(hasher_int(&int_func1) != hasher_int(&int_func2));
+ BOOST_CHECK(hasher_int(&int_func1) != hasher_int(0));
 #if defined(TEST_EXTENSIONS)
- BOOST_TEST(hasher_void(&void_func1)
+ BOOST_CHECK(hasher_void(&void_func1)
             == HASH_NAMESPACE::hash_value(&void_func1));
- BOOST_TEST(hasher_int(&int_func1)
+ BOOST_CHECK(hasher_int(&int_func1)
             == HASH_NAMESPACE::hash_value(&int_func1));
 
     // This isn't specified in Peter's proposal:
- BOOST_TEST(hasher_void(0) == 0);
+ BOOST_CHECK(hasher_void(0) == 0);
 #endif
 }
 
-int main()
+int test_main(int, char**)
 {
     function_pointer_tests();
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_1.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_1.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_1.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -7,7 +7,7 @@
 
 #include "./hash_fwd_test.hpp"
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #if defined(TEST_EXTENSIONS) && !defined(TEST_STD_INCLUDES)
 
@@ -24,8 +24,8 @@
     HASH_NAMESPACE::hash<test::test_type1<int> > hasher_test_int;
     HASH_NAMESPACE::hash<test::test_type1<std::string> > hasher_test_string;
 
- BOOST_TEST(hasher_int(5) == hasher_test_int(x));
- BOOST_TEST(hasher_string("Test") == hasher_test_string(y));
+ BOOST_CHECK(hasher_int(5) == hasher_test_int(x));
+ BOOST_CHECK(hasher_string("Test") == hasher_test_string(y));
 }
 
 void fwd_test2()
@@ -44,8 +44,8 @@
     HASH_NAMESPACE::hash<test::test_type2<int> > hasher_test_int;
     HASH_NAMESPACE::hash<test::test_type2<std::string> > hasher_test_string;
 
- BOOST_TEST(seed1 == hasher_test_int(x));
- BOOST_TEST(seed2 == hasher_test_string(y));
+ BOOST_CHECK(seed1 == hasher_test_int(x));
+ BOOST_CHECK(seed2 == hasher_test_string(y));
 }
 
 void fwd_test3()
@@ -75,19 +75,19 @@
     HASH_NAMESPACE::hash<test::test_type3<int> > hasher_test_int;
     HASH_NAMESPACE::hash<test::test_type3<std::string> > hasher_test_string;
 
- BOOST_TEST(seed1 == hasher_test_int(x));
- BOOST_TEST(seed2 == hasher_test_string(y));
+ BOOST_CHECK(seed1 == hasher_test_int(x));
+ BOOST_CHECK(seed2 == hasher_test_string(y));
 }
 
 #endif
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     fwd_test1();
     fwd_test2();
     fwd_test3();
 #endif
- return boost::report_errors();
+ return 0;
 }
 

Modified: branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_2.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_2.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_fwd_test_2.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -8,7 +8,7 @@
 
 #include "./hash_fwd_test.hpp"
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 template <class T> void unused(T const&) {}
 
@@ -31,9 +31,9 @@
 }
 
 
-int main()
+int test_main(int, char**)
 {
     fwd_test();
- return boost::report_errors();
+ return 0;
 }
 

Modified: branches/unordered/dev/libs/functional/hash/test/hash_global_namespace_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_global_namespace_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_global_namespace_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -48,7 +48,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -59,13 +59,13 @@
 void custom_tests()
 {
     HASH_NAMESPACE::hash<custom> custom_hasher;
- BOOST_TEST(custom_hasher(10) == 100u);
+ BOOST_CHECK(custom_hasher(10) == 100u);
     custom x(55);
- BOOST_TEST(custom_hasher(x) == 550u);
+ BOOST_CHECK(custom_hasher(x) == 550u);
 
     {
         using namespace HASH_NAMESPACE;
- BOOST_TEST(custom_hasher(x) == hash_value(x));
+ BOOST_CHECK(custom_hasher(x) == hash_value(x));
     }
 
     std::vector<custom> custom_vector;
@@ -83,19 +83,19 @@
     HASH_NAMESPACE::hash_combine(seed2, 250u);
     HASH_NAMESPACE::hash_combine(seed2, 350u);
 
- BOOST_TEST(seed ==
+ BOOST_CHECK(seed ==
             HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
- BOOST_TEST(seed == seed2);
+ BOOST_CHECK(seed == seed2);
 }
 
 #endif // TEST_EXTENSIONS
 
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     custom_tests();
 #endif
- return boost::report_errors();
+ return 0;
 }
 

Modified: branches/unordered/dev/libs/functional/hash/test/hash_list_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_list_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_list_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -25,11 +25,11 @@
 
 #endif // TEST_EXTENSIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     list_tests::list_hash_integer_tests();
 #endif
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_long_double_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_long_double_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_long_double_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -5,7 +5,7 @@
 
 #include "hash_float_test.hpp"
 
-int main()
+int test_main(int, char**)
 {
     std::cerr<<"Compiler: "<<BOOST_COMPILER<<"\n";
     std::cerr<<"Platform: "<<BOOST_PLATFORM<<"\n";
@@ -13,5 +13,5 @@
 
     float_tests("long double", (long double*) 0);
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_map_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_map_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_map_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <map>
 
@@ -29,12 +29,12 @@
 
 #endif // TEST_EXTENSTIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     map_tests::map_hash_integer_tests();
     multimap_tests::multimap_hash_integer_tests();
 #endif
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_map_test.hpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_map_test.hpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_map_test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -38,17 +38,17 @@
         HASH_NAMESPACE::hash<T> hasher;
 
         for(int i2 = 0; i2 < number_of_containers; ++i2) {
- BOOST_TEST(hasher(containers[i2]) == hasher(containers[i2]));
+ BOOST_CHECK(hasher(containers[i2]) == hasher(containers[i2]));
 
- BOOST_TEST(hasher(containers[i2]) ==
+ BOOST_CHECK(hasher(containers[i2]) ==
                     HASH_NAMESPACE::hash_value(containers[i2]));
 
- BOOST_TEST(hasher(containers[i2])
+ BOOST_CHECK(hasher(containers[i2])
                     == HASH_NAMESPACE::hash_range(
                         containers[i2].begin(), containers[i2].end()));
 
             for(int j2 = i2 + 1; j2 < number_of_containers; ++j2) {
- BOOST_TEST(
+ BOOST_CHECK(
                         (containers[i2] == containers[j2]) ==
                         (hasher(containers[i2]) == hasher(containers[j2]))
                         );

Modified: branches/unordered/dev/libs/functional/hash/test/hash_no_ext_fail_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_no_ext_fail_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_no_ext_fail_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -12,7 +12,7 @@
 #include <boost/functional/hash.hpp>
 #include <boost/functional/hash.hpp>
 
-int main()
+int test_main(int, char**)
 {
     HASH_NAMESPACE::hash< int[10] > hasher;
     return 0;

Modified: branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_1.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_1.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_1.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -7,11 +7,11 @@
 #include <boost/functional/hash.hpp>
 #define BOOST_HASH_NO_EXTENSIONS
 #include <boost/functional/hash.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 #include <deque>
 #include <cassert>
 
-int main()
+int test_main(int, char**)
 {
     std::deque<int> x;
 
@@ -19,7 +19,7 @@
     x.push_back(2);
 
     HASH_NAMESPACE::hash<std::deque<int> > hasher;
- BOOST_TEST(hasher(x) == HASH_NAMESPACE::hash_value(x));
+ BOOST_CHECK(hasher(x) == HASH_NAMESPACE::hash_value(x));
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_2.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_2.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_no_ext_macro_2.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -8,10 +8,10 @@
 #include <boost/functional/hash.hpp>
 #undef BOOST_HASH_NO_EXTENSIONS
 #include <boost/functional/hash.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 #include <map>
 
-int main()
+int test_main(int, char**)
 {
     std::map<int, int> x;
 
@@ -19,7 +19,7 @@
     x.insert(std::map<int, int>::value_type(14, -75));
 
     HASH_NAMESPACE::hash<std::map<int, int> > hasher;
- BOOST_TEST(hasher(x) == HASH_NAMESPACE::hash_value(x));
+ BOOST_CHECK(hasher(x) == HASH_NAMESPACE::hash_value(x));
     
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_number_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_number_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_number_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -12,7 +12,7 @@
 #endif
 
 #include <iostream>
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <boost/preprocessor/cat.hpp>
 #include <boost/limits.hpp>
@@ -39,27 +39,27 @@
     HASH_NAMESPACE::hash<T> x2;
 
     T v1 = (T) -5;
- BOOST_TEST(x1(v1) == x2(v1));
- BOOST_TEST(x1(T(-5)) == x2(T(-5)));
- BOOST_TEST(x1(T(0)) == x2(T(0)));
- BOOST_TEST(x1(T(10)) == x2(T(10)));
- BOOST_TEST(x1(T(25)) == x2(T(25)));
- BOOST_TEST(x1(T(5) - T(5)) == x2(T(0)));
- BOOST_TEST(x1(T(6) + T(4)) == x2(T(10)));
+ BOOST_CHECK(x1(v1) == x2(v1));
+ BOOST_CHECK(x1(T(-5)) == x2(T(-5)));
+ BOOST_CHECK(x1(T(0)) == x2(T(0)));
+ BOOST_CHECK(x1(T(10)) == x2(T(10)));
+ BOOST_CHECK(x1(T(25)) == x2(T(25)));
+ BOOST_CHECK(x1(T(5) - T(5)) == x2(T(0)));
+ BOOST_CHECK(x1(T(6) + T(4)) == x2(T(10)));
 
 #if defined(TEST_EXTENSIONS)
- BOOST_TEST(x1(T(-5)) == HASH_NAMESPACE::hash_value(T(-5)));
- BOOST_TEST(x1(T(0)) == HASH_NAMESPACE::hash_value(T(0)));
- BOOST_TEST(x1(T(10)) == HASH_NAMESPACE::hash_value(T(10)));
- BOOST_TEST(x1(T(25)) == HASH_NAMESPACE::hash_value(T(25)));
+ BOOST_CHECK(x1(T(-5)) == HASH_NAMESPACE::hash_value(T(-5)));
+ BOOST_CHECK(x1(T(0)) == HASH_NAMESPACE::hash_value(T(0)));
+ BOOST_CHECK(x1(T(10)) == HASH_NAMESPACE::hash_value(T(10)));
+ BOOST_CHECK(x1(T(25)) == HASH_NAMESPACE::hash_value(T(25)));
 
     if (limits::is_integer)
     {
         if(limits::is_signed || limits::digits <= boost::hash_detail::limits<std::size_t>::digits)
- BOOST_TEST(HASH_NAMESPACE::hash_value(T(-5)) == (std::size_t)T(-5));
- BOOST_TEST(HASH_NAMESPACE::hash_value(T(0)) == (std::size_t)T(0u));
- BOOST_TEST(HASH_NAMESPACE::hash_value(T(10)) == (std::size_t)T(10u));
- BOOST_TEST(HASH_NAMESPACE::hash_value(T(25)) == (std::size_t)T(25u));
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(T(-5)) == (std::size_t)T(-5));
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(T(0)) == (std::size_t)T(0u));
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(T(10)) == (std::size_t)T(10u));
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(T(25)) == (std::size_t)T(25u));
     }
 #endif
 }
@@ -77,18 +77,18 @@
         T min_value = (limits::min)();
         T max_value = (limits::max)();
 
- BOOST_TEST(x1(min_value) == x2((limits::min)()));
- BOOST_TEST(x1(max_value) == x2((limits::max)()));
+ BOOST_CHECK(x1(min_value) == x2((limits::min)()));
+ BOOST_CHECK(x1(max_value) == x2((limits::max)()));
 
 #if defined(TEST_EXTENSIONS)
- BOOST_TEST(x1(min_value) == HASH_NAMESPACE::hash_value(min_value));
- BOOST_TEST(x1(max_value) == HASH_NAMESPACE::hash_value(max_value));
+ BOOST_CHECK(x1(min_value) == HASH_NAMESPACE::hash_value(min_value));
+ BOOST_CHECK(x1(max_value) == HASH_NAMESPACE::hash_value(max_value));
 
         if (limits::is_integer)
         {
- BOOST_TEST(HASH_NAMESPACE::hash_value(min_value)
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(min_value)
                     == std::size_t(min_value));
- BOOST_TEST(HASH_NAMESPACE::hash_value(max_value)
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(max_value)
                     == std::size_t(max_value));
         }
 #endif
@@ -106,11 +106,11 @@
     // A hash function can legally fail these tests, but it'll not be a good
     // sign.
     if(T(1) != T(-1))
- BOOST_TEST(x1(T(1)) != x2(T(-1)));
+ BOOST_CHECK(x1(T(1)) != x2(T(-1)));
     if(T(1) != T(2))
- BOOST_TEST(x1(T(1)) != x2(T(2)));
+ BOOST_CHECK(x1(T(1)) != x2(T(2)));
     if((limits::max)() != (limits::max)() - 1)
- BOOST_TEST(x1((limits::max)()) != x2((limits::max)() - 1));
+ BOOST_CHECK(x1((limits::max)()) != x2((limits::max)() - 1));
 }
 
 void bool_test()
@@ -118,10 +118,10 @@
     HASH_NAMESPACE::hash<bool> x1;
     HASH_NAMESPACE::hash<bool> x2;
     
- BOOST_TEST(x1(true) == x2(true));
- BOOST_TEST(x1(false) == x2(false));
- BOOST_TEST(x1(true) != x2(false));
- BOOST_TEST(x1(false) != x2(true));
+ BOOST_CHECK(x1(true) == x2(true));
+ BOOST_CHECK(x1(false) == x2(false));
+ BOOST_CHECK(x1(true) != x2(false));
+ BOOST_CHECK(x1(false) != x2(true));
 }
 
 #define NUMERIC_TEST(type, name) \
@@ -134,7 +134,7 @@
     numeric_test((type*) 0); \
     poor_quality_tests((type*) 0);
 
-int main()
+int test_main(int, char**)
 {
     NUMERIC_TEST(char, char)
     NUMERIC_TEST(signed char, schar)
@@ -159,7 +159,7 @@
 
     bool_test();
 
- return boost::report_errors();
+ return 0;
 }
 
 #if defined(BOOST_MSVC)

Modified: branches/unordered/dev/libs/functional/hash/test/hash_pointer_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_pointer_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_pointer_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -11,7 +11,7 @@
 # include <boost/functional/hash.hpp>
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <boost/limits.hpp>
 #include <boost/mpl/assert.hpp>
@@ -30,20 +30,20 @@
     int int1;
     int int2;
 
- BOOST_TEST(x1(0) == x2(0));
- BOOST_TEST(x1(&int1) == x2(&int1));
- BOOST_TEST(x1(&int2) == x2(&int2));
+ BOOST_CHECK(x1(0) == x2(0));
+ BOOST_CHECK(x1(&int1) == x2(&int1));
+ BOOST_CHECK(x1(&int2) == x2(&int2));
 #if defined(TEST_EXTENSIONS)
- BOOST_TEST(x1(&int1) == HASH_NAMESPACE::hash_value(&int1));
- BOOST_TEST(x1(&int2) == HASH_NAMESPACE::hash_value(&int2));
+ BOOST_CHECK(x1(&int1) == HASH_NAMESPACE::hash_value(&int1));
+ BOOST_CHECK(x1(&int2) == HASH_NAMESPACE::hash_value(&int2));
 
     // This isn't specified in Peter's proposal:
- BOOST_TEST(x1(0) == 0);
+ BOOST_CHECK(x1(0) == 0);
 #endif
 }
 
-int main()
+int test_main(int, char**)
 {
     pointer_tests();
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_range_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_range_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_range_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -41,45 +41,45 @@
     std::vector<int> x;
 
     std::size_t x_seed = 0;
- BOOST_TEST(x_seed == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
+ BOOST_CHECK(x_seed == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
 
- BOOST_TEST(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
         == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
- BOOST_TEST(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
         != HASH_NAMESPACE::hash_range(values1.begin(), values1.end()));
 
     x.push_back(10);
     HASH_NAMESPACE::hash_combine(x_seed, 10);
- BOOST_TEST(x_seed == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
+ BOOST_CHECK(x_seed == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
 
- BOOST_TEST(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
         != HASH_NAMESPACE::hash_range(x.begin(), x.end()));
- BOOST_TEST(HASH_NAMESPACE::hash_range(values2.begin(), values2.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(values2.begin(), values2.end())
         == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
 
     x.push_back(20);
     HASH_NAMESPACE::hash_combine(x_seed, 20);
- BOOST_TEST(x_seed == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
+ BOOST_CHECK(x_seed == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
 
- BOOST_TEST(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(empty.begin(), empty.end())
         != HASH_NAMESPACE::hash_range(x.begin(), x.end()));
- BOOST_TEST(HASH_NAMESPACE::hash_range(values2.begin(), values2.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(values2.begin(), values2.end())
         != HASH_NAMESPACE::hash_range(x.begin(), x.end()));
- BOOST_TEST(HASH_NAMESPACE::hash_range(values3.begin(), values3.end())
+ BOOST_CHECK(HASH_NAMESPACE::hash_range(values3.begin(), values3.end())
         == HASH_NAMESPACE::hash_range(x.begin(), x.end()));
 
     std::size_t seed = HASH_NAMESPACE::hash_range(values3.begin(), values3.end());
     HASH_NAMESPACE::hash_range(seed, values4.begin(), values4.end());
     HASH_NAMESPACE::hash_range(seed, x.begin(), x.end());
- BOOST_TEST(seed == HASH_NAMESPACE::hash_range(values5.begin(), values5.end()));
+ BOOST_CHECK(seed == HASH_NAMESPACE::hash_range(values5.begin(), values5.end()));
 }
 
 #endif
 
-int main()
+int test_main(int, char**)
 {
     hash_range_tests();
 
- return boost::report_errors();
+ return 0;
 }
 

Modified: branches/unordered/dev/libs/functional/hash/test/hash_sequence_test.hpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_sequence_test.hpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_sequence_test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -41,17 +41,17 @@
         HASH_NAMESPACE::hash<T> hasher;
 
         for(int i2 = 0; i2 < number_of_containers; ++i2) {
- BOOST_TEST(hasher(containers[i2]) == hasher(containers[i2]));
+ BOOST_CHECK(hasher(containers[i2]) == hasher(containers[i2]));
 
- BOOST_TEST(hasher(containers[i2]) ==
+ BOOST_CHECK(hasher(containers[i2]) ==
                     HASH_NAMESPACE::hash_value(containers[i2]));
 
- BOOST_TEST(hasher(containers[i2])
+ BOOST_CHECK(hasher(containers[i2])
                     == HASH_NAMESPACE::hash_range(
                         containers[i2].begin(), containers[i2].end()));
 
             for(int j2 = i2 + 1; j2 < number_of_containers; ++j2) {
- BOOST_TEST(
+ BOOST_CHECK(
                         (containers[i2] == containers[j2]) ==
                         (hasher(containers[i2]) == hasher(containers[j2]))
                         );

Modified: branches/unordered/dev/libs/functional/hash/test/hash_set_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_set_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_set_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -29,12 +29,12 @@
 
 #endif
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     set_tests::set_hash_integer_tests();
     multiset_tests::multiset_hash_integer_tests();
 #endif
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_set_test.hpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_set_test.hpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_set_test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -44,17 +44,17 @@
         HASH_NAMESPACE::hash<T> hasher;
 
         for(int i2 = 0; i2 < number_of_containers; ++i2) {
- BOOST_TEST(hasher(containers[i2]) == hasher(containers[i2]));
+ BOOST_CHECK(hasher(containers[i2]) == hasher(containers[i2]));
 
- BOOST_TEST(hasher(containers[i2]) ==
+ BOOST_CHECK(hasher(containers[i2]) ==
                     HASH_NAMESPACE::hash_value(containers[i2]));
 
- BOOST_TEST(hasher(containers[i2])
+ BOOST_CHECK(hasher(containers[i2])
                     == HASH_NAMESPACE::hash_range(
                         containers[i2].begin(), containers[i2].end()));
 
             for(int j2 = i2 + 1; j2 < number_of_containers; ++j2) {
- BOOST_TEST(
+ BOOST_CHECK(
                         (containers[i2] == containers[j2]) ==
                         (hasher(containers[i2]) == hasher(containers[j2]))
                         );

Modified: branches/unordered/dev/libs/functional/hash/test/hash_string_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_string_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_string_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -11,7 +11,7 @@
 # include <boost/functional/hash.hpp>
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <boost/limits.hpp>
 #include <boost/mpl/assert.hpp>
@@ -27,18 +27,18 @@
     HASH_NAMESPACE::hash<std::string> x1;
     HASH_NAMESPACE::hash<std::string> x2;
 
- BOOST_TEST(x1("Hello") == x2(std::string("Hel") + "lo"));
- BOOST_TEST(x1("") == x2(std::string()));
+ BOOST_CHECK(x1("Hello") == x2(std::string("Hel") + "lo"));
+ BOOST_CHECK(x1("") == x2(std::string()));
 
 #if defined(TEST_EXTENSIONS)
     std::string value1;
     std::string value2("Hello");
 
- BOOST_TEST(x1(value1) == HASH_NAMESPACE::hash_value(value1));
- BOOST_TEST(x1(value2) == HASH_NAMESPACE::hash_value(value2));
- BOOST_TEST(HASH_NAMESPACE::hash_value(value1) ==
+ BOOST_CHECK(x1(value1) == HASH_NAMESPACE::hash_value(value1));
+ BOOST_CHECK(x1(value2) == HASH_NAMESPACE::hash_value(value2));
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(value1) ==
             HASH_NAMESPACE::hash_range(value1.begin(), value1.end()));
- BOOST_TEST(HASH_NAMESPACE::hash_value(value2) ==
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(value2) ==
             HASH_NAMESPACE::hash_range(value2.begin(), value2.end()));
 #endif
 }
@@ -51,28 +51,28 @@
     HASH_NAMESPACE::hash<std::wstring> x1;
     HASH_NAMESPACE::hash<std::wstring> x2;
 
- BOOST_TEST(x1(L"Hello") == x2(std::wstring(L"Hel") + L"lo"));
- BOOST_TEST(x1(L"") == x2(std::wstring()));
+ BOOST_CHECK(x1(L"Hello") == x2(std::wstring(L"Hel") + L"lo"));
+ BOOST_CHECK(x1(L"") == x2(std::wstring()));
 
 #if defined(TEST_EXTENSIONS)
     std::wstring value1;
     std::wstring value2(L"Hello");
 
- BOOST_TEST(x1(value1) == HASH_NAMESPACE::hash_value(value1));
- BOOST_TEST(x1(value2) == HASH_NAMESPACE::hash_value(value2));
- BOOST_TEST(HASH_NAMESPACE::hash_value(value1) ==
+ BOOST_CHECK(x1(value1) == HASH_NAMESPACE::hash_value(value1));
+ BOOST_CHECK(x1(value2) == HASH_NAMESPACE::hash_value(value2));
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(value1) ==
             HASH_NAMESPACE::hash_range(value1.begin(), value1.end()));
- BOOST_TEST(HASH_NAMESPACE::hash_value(value2) ==
+ BOOST_CHECK(HASH_NAMESPACE::hash_value(value2) ==
             HASH_NAMESPACE::hash_range(value2.begin(), value2.end()));
 #endif
 }
 #endif
 
-int main()
+int test_main(int, char**)
 {
     string_tests();
 #if !defined(BOOST_NO_STD_WSTRING)
     wstring_tests();
 #endif
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/hash_value_array_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_value_array_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_value_array_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -16,7 +16,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -37,9 +37,9 @@
     int array3[2] = {2, 3};
     HASH_NAMESPACE::hash<int[2]> hasher3;
 
- BOOST_TEST(hasher1(array1) == HASH_NAMESPACE::hash_value(array1));
- BOOST_TEST(hasher2(array2) == HASH_NAMESPACE::hash_value(array2));
- BOOST_TEST(hasher3(array3) == HASH_NAMESPACE::hash_value(array3));
+ BOOST_CHECK(hasher1(array1) == HASH_NAMESPACE::hash_value(array1));
+ BOOST_CHECK(hasher2(array2) == HASH_NAMESPACE::hash_value(array2));
+ BOOST_CHECK(hasher3(array3) == HASH_NAMESPACE::hash_value(array3));
 }
 
 void two_dimensional_array_test()
@@ -47,18 +47,18 @@
     int array[3][2] = {{-5, 6}, {7, -3}, {26, 1}};
     HASH_NAMESPACE::hash<int[3][2]> hasher;
 
- BOOST_TEST(hasher(array) == HASH_NAMESPACE::hash_value(array));
+ BOOST_CHECK(hasher(array) == HASH_NAMESPACE::hash_value(array));
 }
 
 #endif
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     array_int_test();
     two_dimensional_array_test();
 #endif
 
- return boost::report_errors();
+ return 0;
 }
 

Modified: branches/unordered/dev/libs/functional/hash/test/hash_vector_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/hash_vector_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/hash_vector_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -13,7 +13,7 @@
 # endif
 #endif
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #ifdef TEST_EXTENSIONS
 
@@ -25,11 +25,11 @@
 
 #endif // TEST_EXTENSIONS
 
-int main()
+int test_main(int, char**)
 {
 #ifdef TEST_EXTENSIONS
     vector_tests::vector_hash_integer_tests();
 #endif
 
- return boost::report_errors();
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/link_ext_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/link_ext_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/link_ext_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -5,13 +5,13 @@
 
 #define HASH_NAMESPACE boost
 #include <boost/functional/hash.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 #include <vector>
 
 int f(std::size_t hash1, int* x1) {
     // Check that HASH_NAMESPACE::hash<int*> works in both files.
     HASH_NAMESPACE::hash<int*> ptr_hasher;
- BOOST_TEST(hash1 == ptr_hasher(x1));
+ BOOST_CHECK(hash1 == ptr_hasher(x1));
 
     // Check that std::vector<std::size_t> is avaiable in this file.
     std::vector<std::size_t> x;

Modified: branches/unordered/dev/libs/functional/hash/test/link_no_ext_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/link_no_ext_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/link_no_ext_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -6,13 +6,14 @@
 #define HASH_NAMESPACE boost
 #define BOOST_HASH_NO_EXTENSIONS
 #include <boost/functional/hash.hpp>
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/assert.hpp>
 
 extern int f(std::size_t, int*);
 
-int main() {
+int test_main(int, char**) {
     HASH_NAMESPACE::hash<int*> ptr_hasher;
     int x = 55;
- BOOST_TEST(!f(ptr_hasher(&x), &x));
- return boost::report_errors();
+
+ BOOST_ASSERT(!f(ptr_hasher(&x), &x));
+ return 0;
 }

Modified: branches/unordered/dev/libs/functional/hash/test/link_test.cpp
==============================================================================
--- branches/unordered/dev/libs/functional/hash/test/link_test.cpp (original)
+++ branches/unordered/dev/libs/functional/hash/test/link_test.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -6,4 +6,4 @@
 #include <boost/functional/hash.hpp>
 
 extern int f();
-int main() { return f(); }
+int main(int, char**) { return f(); }

Modified: branches/unordered/dev/libs/unordered/test/exception/erase_exception_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/exception/erase_exception_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/exception/erase_exception_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -25,7 +25,7 @@
     void check(T const& x) const {
         std::string scope(test::scope);
 
- UNORDERED_CHECK(scope.find("hash::") != std::string::npos ||
+ BOOST_CHECK(scope.find("hash::") != std::string::npos ||
                 scope.find("equal_to::") != std::string::npos ||
                 scope == "operator==(object, object)");
 

Modified: branches/unordered/dev/libs/unordered/test/exception/insert_exception_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/exception/insert_exception_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/exception/insert_exception_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -128,10 +128,10 @@
         size_type bucket_count = x.bucket_count();
         size_type initial_elements = static_cast<size_type>(
             ceil(bucket_count * (double) x.max_load_factor()) - 1);
- UNORDERED_REQUIRE(initial_elements < this->values.size());
+ BOOST_REQUIRE(initial_elements < this->values.size());
         x.insert(this->values.begin(),
                 boost::next(this->values.begin(), initial_elements));
- UNORDERED_REQUIRE(bucket_count == x.bucket_count());
+ BOOST_REQUIRE(bucket_count == x.bucket_count());
         return x;
     }
 
@@ -150,7 +150,7 @@
 
         // This isn't actually a failure, but it means the test isn't doing its
         // job.
- UNORDERED_REQUIRE(x.bucket_count() != bucket_count);
+ BOOST_REQUIRE(x.bucket_count() != bucket_count);
     }
 };
 
@@ -173,7 +173,7 @@
 
         // This isn't actually a failure, but it means the test isn't doing its
         // job.
- UNORDERED_REQUIRE(x.bucket_count() != bucket_count);
+ BOOST_REQUIRE(x.bucket_count() != bucket_count);
     }
 };
 
@@ -197,10 +197,10 @@
 
         size_type initial_elements = rehash_bucket_count - 5;
 
- UNORDERED_REQUIRE(initial_elements < this->values.size());
+ BOOST_REQUIRE(initial_elements < this->values.size());
         x.insert(this->values.begin(),
                 boost::next(this->values.begin(), initial_elements));
- UNORDERED_REQUIRE(original_bucket_count == x.bucket_count());
+ BOOST_REQUIRE(original_bucket_count == x.bucket_count());
         return x;
     }
 
@@ -212,7 +212,7 @@
 
         // This isn't actually a failure, but it means the test isn't doing its
         // job.
- UNORDERED_REQUIRE(x.bucket_count() != bucket_count);
+ BOOST_REQUIRE(x.bucket_count() != bucket_count);
     }
 
     void check(T const& x) const {
@@ -224,8 +224,7 @@
 };
 
 #define BASIC_TESTS \
- (insert_test1)
-//(insert_test2)(insert_test3)(insert_test4) \
+ (insert_test1)(insert_test2)(insert_test3)(insert_test4) \
     (insert_test_rehash1)(insert_test_rehash2)(insert_test_rehash3)
 
 #if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)

Modified: branches/unordered/dev/libs/unordered/test/exception/swap_exception_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/exception/swap_exception_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/exception/swap_exception_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -22,7 +22,7 @@
         std::string scope(test::scope);
 
 #if BOOST_UNORDERED_SWAP_METHOD != 2
- UNORDERED_CHECK(
+ BOOST_CHECK(
                 scope == "hash::operator(hash)" ||
                 scope == "hash::operator=(hash)" ||
                 scope == "equal_to::operator(equal_to)" ||
@@ -77,7 +77,7 @@
         std::string scope(test::scope);
 
 #if BOOST_UNORDERED_SWAP_METHOD != 2
- UNORDERED_CHECK(
+ BOOST_CHECK(
                 scope == "hash::operator(hash)" ||
                 scope == "hash::operator=(hash)" ||
                 scope == "equal_to::operator(equal_to)" ||

Modified: branches/unordered/dev/libs/unordered/test/helpers/exception_test.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/helpers/exception_test.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/helpers/exception_test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -8,7 +8,7 @@
 
 #include "./test.hpp"
 
-#if defined(BOOST_UNORDERED_USE_TEST)
+#if defined(BOOST_UNORDERED_FULL_TEST)
 # define BOOST_TEST_MAIN
 # include <boost/test/exception_safety.hpp>
 # include <boost/test/unit_test.hpp>
@@ -18,7 +18,7 @@
 #include <boost/preprocessor/seq/elem.hpp>
 #include <boost/preprocessor/cat.hpp>
 
-#if defined(BOOST_UNORDERED_USE_TEST)
+#if defined(BOOST_UNORDERED_FULL_TEST)
 # define UNORDERED_EXCEPTION_TEST_CASE(name, test_func, type) \
         UNORDERED_AUTO_TEST(name) \
         { \
@@ -163,6 +163,7 @@
         test_runner(Test const& t) : test_(t) {}
         void operator()() const {
             DISABLE_EXCEPTIONS;
+ test::scope = "";
             BOOST_DEDUCED_TYPENAME Test::data_type x(test_.init());
             BOOST_DEDUCED_TYPENAME Test::strong_type strong;
             strong.store(x);
@@ -180,7 +181,7 @@
     
     
 
-#if defined(BOOST_UNORDERED_USE_TEST)
+#if defined(BOOST_UNORDERED_FULL_TEST)
     template <class Test>
     void exception_safety(Test const& f, char const* name) {
         test_runner<Test> runner(f);
@@ -223,9 +224,15 @@
                     success = true;
                 }
                 catch(test_failure) {
+ BOOST_ERROR("test_failure caught.");
                     break;
                 }
+ catch(test_exception) {
+ continue;
+ }
                 catch(...) {
+ BOOST_ERROR("Unexpected exception.");
+ break;
                 }
             } while(!success);
         }

Modified: branches/unordered/dev/libs/unordered/test/helpers/metafunctions.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/helpers/metafunctions.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/helpers/metafunctions.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -8,11 +8,7 @@
 
 #include <boost/config.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/identity.hpp>
 #include <boost/mpl/not.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/apply.hpp>
 #include <boost/unordered_set.hpp>
 #include <boost/unordered_map.hpp>
 
@@ -82,7 +78,8 @@
 
     // Non Const Value Type
 
- struct map_non_const_value_type
+ template <bool IsMap>
+ struct non_const_value_type_impl
     {
         template <class Container>
         struct apply {
@@ -92,7 +89,8 @@
         };
     };
 
- struct set_non_const_value_type
+ template<>
+ struct non_const_value_type_impl<false>
     {
         template <class Container>
         struct apply {
@@ -102,9 +100,8 @@
     
     template <class Container>
     struct non_const_value_type
- : boost::mpl::apply1<
- BOOST_DEDUCED_TYPENAME boost::mpl::if_<is_map<Container>, map_non_const_value_type, set_non_const_value_type>::type,
- Container>
+ : non_const_value_type_impl< ::test::is_map<Container>::value>::
+ BOOST_NESTED_TEMPLATE apply<Container>
     {
     };
 }

Modified: branches/unordered/dev/libs/unordered/test/helpers/test.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/helpers/test.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/helpers/test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -6,21 +6,17 @@
 #if !defined(BOOST_UNORDERED_TEST_TEST_HEADER)
 #define BOOST_UNORDERED_TEST_TEST_HEADER
 
-#if defined(BOOST_UNORDERED_USE_TEST)
+#if defined(BOOST_UNORDERED_FULL_TEST)
 
 #include <boost/test/test_tools.hpp>
-#define UNORDERED_CHECK(x) BOOST_CHECK(x)
-#define UNORDERED_REQUIRE(x) BOOST_REQUIRE(x)
 #define UNORDERED_AUTO_TEST(x) BOOST_AUTO_TEST_CASE(x)
 #define RUN_TESTS()
 
 #else
 
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/minimal.hpp>
 #include <boost/preprocessor/cat.hpp>
 
-#define UNORDERED_CHECK(x) BOOST_TEST(x)
-#define UNORDERED_REQUIRE(x) if(!(x)) { BOOST_ERROR(BOOST_STRINGIZE(x)); throw ::test::lightweight::test_failure(); }
 #define UNORDERED_AUTO_TEST(x) \
     struct BOOST_PP_CAT(x, _type) : public ::test::registered_test_base { \
         BOOST_PP_CAT(x, _type)() { \
@@ -30,7 +26,8 @@
     }; \
     BOOST_PP_CAT(x, _type) x; \
     void BOOST_PP_CAT(x, _type)::run()
-#define RUN_TESTS() int main() { ::test::test_list::run_tests(); return boost::report_errors(); }
+
+#define RUN_TESTS() int test_main(int, char**) { ::test::test_list::run_tests(); return 0; }
 
 namespace test {
     struct registered_test_base {

Modified: branches/unordered/dev/libs/unordered/test/helpers/tracker.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/helpers/tracker.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/helpers/tracker.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -51,7 +51,7 @@
         std::copy(x2.begin(), x2.end(), std::back_inserter(values2));
         std::sort(values1.begin(), values1.end());
         std::sort(values2.begin(), values2.end());
- BOOST_TEST(values1.size() == values2.size() &&
+ BOOST_CHECK(values1.size() == values2.size() &&
                 std::equal(values1.begin(), values1.end(), values2.begin(), test::equivalent));
     }
 
@@ -65,7 +65,7 @@
         std::copy(x2.first, x2.second, std::back_inserter(values2));
         std::sort(values1.begin(), values1.end());
         std::sort(values2.begin(), values2.end());
- BOOST_TEST(values1.size() == values2.size() &&
+ BOOST_CHECK(values1.size() == values2.size() &&
                 std::equal(values1.begin(), values1.end(), values2.begin(), test::equivalent));
     }
 

Modified: branches/unordered/dev/libs/unordered/test/objects/exception.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/objects/exception.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/objects/exception.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -347,6 +347,16 @@
             detail::tracker.track_construct((void*) p, sizeof(T), tag_);
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+ template<class... Args> void construct(pointer p, Args&&... args) {
+ UNORDERED_SCOPE(allocator::construct(pointer, Args&&...)) {
+ UNORDERED_EPOINT("Mock allocator construct function.");
+ new(p) T(std::forward<Args>(args)...);
+ }
+ detail::tracker.track_construct((void*) p, sizeof(T), tag_);
+ }
+#endif
+
         void destroy(pointer p) {
             detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
             p->~T();

Modified: branches/unordered/dev/libs/unordered/test/objects/memory.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/objects/memory.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/objects/memory.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -103,7 +103,7 @@
 
             void allocator_unref()
             {
- UNORDERED_CHECK(count_allocators > 0);
+ BOOST_CHECK(count_allocators > 0);
                 if(count_allocators > 0) {
                     --count_allocators;
                     if(count_allocators == 0) {
@@ -116,9 +116,9 @@
                         count_constructions = 0;
                         allocated_memory.clear();
 
- UNORDERED_CHECK(no_allocations_left);
- UNORDERED_CHECK(no_constructions_left);
- UNORDERED_CHECK(allocated_memory_empty);
+ BOOST_CHECK(no_allocations_left);
+ BOOST_CHECK(no_constructions_left);
+ BOOST_CHECK(allocated_memory_empty);
                     }
                 }
             }
@@ -144,12 +144,12 @@
                 if(pos == allocated_memory.end()) {
                     BOOST_ERROR("Deallocating unknown pointer.");
                 } else {
- UNORDERED_CHECK(pos->first.start == ptr);
- UNORDERED_CHECK(pos->first.end == (char*) ptr + n * size);
- UNORDERED_CHECK(pos->second.tag_ == tag);
+ BOOST_CHECK(pos->first.start == ptr);
+ BOOST_CHECK(pos->first.end == (char*) ptr + n * size);
+ BOOST_CHECK(pos->second.tag_ == tag);
                     allocated_memory.erase(pos);
                 }
- UNORDERED_CHECK(count_allocations > 0);
+ BOOST_CHECK(count_allocations > 0);
                 if(count_allocations > 0) --count_allocations;
             }
 
@@ -160,7 +160,7 @@
 
             void track_destroy(void* ptr, std::size_t /*size*/, int tag)
             {
- UNORDERED_CHECK(count_constructions > 0);
+ BOOST_CHECK(count_constructions > 0);
                 if(count_constructions > 0) --count_constructions;
             }
         };

Modified: branches/unordered/dev/libs/unordered/test/objects/minimal.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/objects/minimal.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/objects/minimal.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -25,6 +25,7 @@
     class copy_constructible_equality_comparable;
     class default_copy_constructible;
     class assignable;
+
     template <class T> class hash;
     template <class T> class equal_to;
     template <class T> class ptr;
@@ -231,6 +232,13 @@
         }
 
         void construct(pointer p, T const& t) { new((void*)p.ptr_) T(t); }
+
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+ template<class... Args> void construct(pointer p, Args&&... args) {
+ new((void*)p.ptr_) T(std::forward<Args>(args)...);
+ }
+#endif
+
         void destroy(pointer p) { ((T*)p.ptr_)->~T(); }
 
         size_type max_size() const { return 1000; }

Modified: branches/unordered/dev/libs/unordered/test/objects/test.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/objects/test.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/objects/test.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -212,6 +212,13 @@
             new(p) T(t);
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
+ template<class... Args> void construct(pointer p, Args&&... args) {
+ detail::tracker.track_construct((void*) p, sizeof(T), tag_);
+ new(p) T(std::forward<Args>(args)...);
+ }
+#endif
+
         void destroy(pointer p) {
             detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
             p->~T();

Modified: branches/unordered/dev/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/Jamfile.v2 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -21,6 +21,7 @@
         [ run equivalent_keys_tests.cpp ]
         [ run constructor_tests.cpp ]
         [ run copy_tests.cpp ]
+ [ run move_tests.cpp ]
         [ run assign_tests.cpp ]
         [ run insert_tests.cpp ]
         [ run insert_stable_tests.cpp ]

Modified: branches/unordered/dev/libs/unordered/test/unordered/assign_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/assign_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/assign_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -27,9 +27,9 @@
     {
         T x;
         x = x;
- BOOST_TEST(x.empty());
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
     }
 
     std::cerr<<"assign_tests1.2\n";
@@ -47,7 +47,7 @@
         y.max_load_factor(x.max_load_factor() / 20);
         y = x;
         tracker.compare(y);
- BOOST_TEST(x.max_load_factor() == y.max_load_factor());
+ BOOST_CHECK(x.max_load_factor() == y.max_load_factor());
     }
 }
 
@@ -67,8 +67,8 @@
         T x1(v.begin(), v.end(), 0, hf1, eq1);
         T x2(0, hf2, eq2);
         x2 = x1;
- BOOST_TEST(test::equivalent(x2.hash_function(), hf1));
- BOOST_TEST(test::equivalent(x2.key_eq(), eq1));
+ BOOST_CHECK(test::equivalent(x2.hash_function(), hf1));
+ BOOST_CHECK(test::equivalent(x2.key_eq(), eq1));
         test::check_container(x2, v);
     }
 
@@ -78,9 +78,9 @@
         T x1(v1.begin(), v1.end(), 0, hf1, eq1, al1);
         T x2(v2.begin(), v2.end(), 0, hf2, eq2, al2);
         x2 = x1;
- BOOST_TEST(test::equivalent(x2.hash_function(), hf1));
- BOOST_TEST(test::equivalent(x2.key_eq(), eq1));
- BOOST_TEST(test::equivalent(x2.get_allocator(), al2));
+ BOOST_CHECK(test::equivalent(x2.hash_function(), hf1));
+ BOOST_CHECK(test::equivalent(x2.key_eq(), eq1));
+ BOOST_CHECK(test::equivalent(x2.get_allocator(), al2));
         test::check_container(x2, v1);
     }
 }

Modified: branches/unordered/dev/libs/unordered/test/unordered/at_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/at_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/at_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -16,8 +16,8 @@
     x["one"] = 1;
     x["two"] = 2;
 
- BOOST_TEST(x.at("one") == 1);
- BOOST_TEST(x.at("two") == 2);
+ BOOST_CHECK(x.at("one") == 1);
+ BOOST_CHECK(x.at("two") == 2);
 
     try {
         x.at("three");

Modified: branches/unordered/dev/libs/unordered/test/unordered/bucket_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/bucket_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/bucket_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -24,7 +24,7 @@
 
     X x(v.begin(), v.end());
 
- BOOST_TEST(x.bucket_count() < x.max_bucket_count());
+ BOOST_CHECK(x.bucket_count() < x.max_bucket_count());
     std::cerr<<x.bucket_count()<<"<"<<x.max_bucket_count()<<"\n";
 
     for(BOOST_DEDUCED_TYPENAME test::random_values<X>::const_iterator
@@ -32,21 +32,21 @@
     {
         size_type bucket = x.bucket(test::get_key<X>(*it));
 
- BOOST_TEST(bucket < x.bucket_count());
+ BOOST_CHECK(bucket < x.bucket_count());
         if(bucket < x.max_bucket_count()) {
             // lit? lend?? I need a new naming scheme.
             const_local_iterator lit = x.begin(bucket), lend = x.end(bucket);
             while(lit != lend && test::get_key<X>(*it) != test::get_key<X>(*lit)) ++lit;
- BOOST_TEST(lit != lend);
+ BOOST_CHECK(lit != lend);
         }
     }
 
     for(size_type i = 0; i < x.bucket_count(); ++i) {
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x.begin(i), x.end(i)));
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x.cbegin(i), x.cend(i)));
+ BOOST_CHECK(x.bucket_size(i) == (size_type) std::distance(x.begin(i), x.end(i)));
+ BOOST_CHECK(x.bucket_size(i) == (size_type) std::distance(x.cbegin(i), x.cend(i)));
         X const& x_ref = x;
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x_ref.begin(i), x_ref.end(i)));
- BOOST_TEST(x.bucket_size(i) == (size_type) std::distance(x_ref.cbegin(i), x_ref.cend(i)));
+ BOOST_CHECK(x.bucket_size(i) == (size_type) std::distance(x_ref.begin(i), x_ref.end(i)));
+ BOOST_CHECK(x.bucket_size(i) == (size_type) std::distance(x_ref.cbegin(i), x_ref.cend(i)));
     }
 }
 

Modified: branches/unordered/dev/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/compile_tests.hpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -86,10 +86,10 @@
     // I'm not sure about either of these tests...
     size_type max_diff((std::numeric_limits<difference_type>::max)());
     difference_type converted_diff(max_diff);
- BOOST_TEST((std::numeric_limits<difference_type>::max)()
+ BOOST_CHECK((std::numeric_limits<difference_type>::max)()
             == converted_diff);
 
- BOOST_TEST(
+ BOOST_CHECK(
         static_cast<comparison_type>(
             (std::numeric_limits<size_type>::max)()) >
         static_cast<comparison_type>(
@@ -97,8 +97,8 @@
 
     // I don't test the runtime post-conditions here.
     X u;
- BOOST_TEST(u.size() == 0);
- BOOST_TEST(X().size() == 0);
+ BOOST_CHECK(u.size() == 0);
+ BOOST_CHECK(X().size() == 0);
 
     X a,b;
 
@@ -125,6 +125,11 @@
     test::check_return_type<size_type>::equals(a.size());
     test::check_return_type<size_type>::equals(a.max_size());
     test::check_return_type<bool>::convertible(a.empty());
+
+ // Allocator
+
+ typedef BOOST_DEDUCED_TYPENAME X::allocator_type allocator_type;
+ test::check_return_type<allocator_type>::equals(a_const.get_allocator());
 }
 
 template <class X, class Key>
@@ -284,7 +289,7 @@
     a.insert(i, j);
     test::check_return_type<size_type>::equals(a.erase(k));
 
- BOOST_TEST(a.empty());
+ BOOST_CHECK(a.empty());
     if(a.empty()) {
         a.insert(t);
         q = a.cbegin();

Modified: branches/unordered/dev/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/constructor_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -29,42 +29,42 @@
     std::cerr<<"Construct 1\n";
     {
         T x(0, hf, eq);
- BOOST_TEST(x.empty());
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
     std::cerr<<"Construct 2\n";
     {
         T x(100, hf);
- BOOST_TEST(x.empty());
- BOOST_TEST(x.bucket_count() >= 100);
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(x.bucket_count() >= 100);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
     std::cerr<<"Construct 3\n";
     {
         T x(2000);
- BOOST_TEST(x.empty());
- BOOST_TEST(x.bucket_count() >= 2000);
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(x.bucket_count() >= 2000);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
     std::cerr<<"Construct 4\n";
     {
         T x;
- BOOST_TEST(x.empty());
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
@@ -72,10 +72,10 @@
     {
         test::random_values<T> v(1000, generator);
         T x(v.begin(), v.end(), 10000, hf, eq);
- BOOST_TEST(x.bucket_count() >= 10000);
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.bucket_count() >= 10000);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }
@@ -84,10 +84,10 @@
     {
         test::random_values<T> v(10, generator);
         T x(v.begin(), v.end(), 10000, hf);
- BOOST_TEST(x.bucket_count() >= 10000);
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.bucket_count() >= 10000);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }
@@ -96,10 +96,10 @@
     {
         test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 100);
- BOOST_TEST(x.bucket_count() >= 100);
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.bucket_count() >= 100);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }
@@ -108,9 +108,9 @@
     {
         test::random_values<T> v(1, generator);
         T x(v.begin(), v.end());
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }
@@ -118,10 +118,10 @@
     std::cerr<<"Construct 9\n";
     {
         T x(0, hf, eq, al);
- BOOST_TEST(x.empty());
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
@@ -129,10 +129,10 @@
     {
         test::random_values<T> v(1000, generator);
         T x(v.begin(), v.end(), 10000, hf, eq, al);
- BOOST_TEST(x.bucket_count() >= 10000);
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.bucket_count() >= 10000);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }
@@ -141,10 +141,10 @@
     {
         test::random_values<T> v(1000, generator);
         T x(al);
- BOOST_TEST(x.empty());
- BOOST_TEST(test::equivalent(x.hash_function(), hf));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 }
@@ -165,21 +165,21 @@
     std::cerr<<"Construct 1\n";
     {
         T x(10000, hf1, eq1);
- BOOST_TEST(x.bucket_count() >= 10000);
- BOOST_TEST(test::equivalent(x.hash_function(), hf1));
- BOOST_TEST(test::equivalent(x.key_eq(), eq1));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.bucket_count() >= 10000);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf1));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq1));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
     std::cerr<<"Construct 2\n";
     {
         T x(100, hf1);
- BOOST_TEST(x.empty());
- BOOST_TEST(x.bucket_count() >= 100);
- BOOST_TEST(test::equivalent(x.hash_function(), hf1));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(x.bucket_count() >= 100);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf1));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_equivalent_keys(x);
     }
 
@@ -187,9 +187,9 @@
     {
         test::random_values<T> v(100, generator);
         T x(v.begin(), v.end(), 0, hf1, eq1);
- BOOST_TEST(test::equivalent(x.hash_function(), hf1));
- BOOST_TEST(test::equivalent(x.key_eq(), eq1));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf1));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq1));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }
@@ -198,10 +198,10 @@
     {
         test::random_values<T> v(5, generator);
         T x(v.begin(), v.end(), 1000, hf1);
- BOOST_TEST(x.bucket_count() >= 1000);
- BOOST_TEST(test::equivalent(x.hash_function(), hf1));
- BOOST_TEST(test::equivalent(x.key_eq(), eq));
- BOOST_TEST(test::equivalent(x.get_allocator(), al));
+ BOOST_CHECK(x.bucket_count() >= 1000);
+ BOOST_CHECK(test::equivalent(x.hash_function(), hf1));
+ BOOST_CHECK(test::equivalent(x.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(x.get_allocator(), al));
         test::check_container(x, v);
         test::check_equivalent_keys(x);
     }

Modified: branches/unordered/dev/libs/unordered/test/unordered/copy_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/copy_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/copy_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -27,11 +27,11 @@
     {
         T x;
         T y(x);
- BOOST_TEST(y.empty());
- BOOST_TEST(test::equivalent(y.hash_function(), hf));
- BOOST_TEST(test::equivalent(y.key_eq(), eq));
- BOOST_TEST(test::equivalent(y.get_allocator(), al));
- BOOST_TEST(x.max_load_factor() == y.max_load_factor());
+ BOOST_CHECK(y.empty());
+ BOOST_CHECK(test::equivalent(y.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(y.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(y.get_allocator(), al));
+ BOOST_CHECK(x.max_load_factor() == y.max_load_factor());
         test::check_equivalent_keys(y);
     }
 
@@ -57,7 +57,7 @@
         test::unordered_equivalence_tester<T> equivalent(x);
         equivalent(y);
         // This isn't guaranteed:
- BOOST_TEST(y.load_factor() < y.max_load_factor());
+ BOOST_CHECK(y.load_factor() < y.max_load_factor());
         test::check_equivalent_keys(y);
     }
 }
@@ -75,22 +75,22 @@
     {
         T x(10000, hf, eq, al);
         T y(x);
- BOOST_TEST(y.empty());
- BOOST_TEST(test::equivalent(y.hash_function(), hf));
- BOOST_TEST(test::equivalent(y.key_eq(), eq));
- BOOST_TEST(test::equivalent(y.get_allocator(), al));
- BOOST_TEST(x.max_load_factor() == y.max_load_factor());
+ BOOST_CHECK(y.empty());
+ BOOST_CHECK(test::equivalent(y.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(y.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(y.get_allocator(), al));
+ BOOST_CHECK(x.max_load_factor() == y.max_load_factor());
         test::check_equivalent_keys(y);
     }
 
     {
         T x(1000, hf, eq, al);
         T y(x, al2);
- BOOST_TEST(y.empty());
- BOOST_TEST(test::equivalent(y.hash_function(), hf));
- BOOST_TEST(test::equivalent(y.key_eq(), eq));
- BOOST_TEST(test::equivalent(y.get_allocator(), al2));
- BOOST_TEST(x.max_load_factor() == y.max_load_factor());
+ BOOST_CHECK(y.empty());
+ BOOST_CHECK(test::equivalent(y.hash_function(), hf));
+ BOOST_CHECK(test::equivalent(y.key_eq(), eq));
+ BOOST_CHECK(test::equivalent(y.get_allocator(), al2));
+ BOOST_CHECK(x.max_load_factor() == y.max_load_factor());
         test::check_equivalent_keys(y);
     }
 
@@ -102,7 +102,7 @@
         test::unordered_equivalence_tester<T> equivalent(x);
         equivalent(y);
         test::check_equivalent_keys(y);
- BOOST_TEST(test::equivalent(y.get_allocator(), al));
+ BOOST_CHECK(test::equivalent(y.get_allocator(), al));
     }
 
     {
@@ -113,7 +113,7 @@
         test::unordered_equivalence_tester<T> equivalent(x);
         equivalent(y);
         test::check_equivalent_keys(y);
- BOOST_TEST(test::equivalent(y.get_allocator(), al2));
+ BOOST_CHECK(test::equivalent(y.get_allocator(), al2));
     }
 }
 

Modified: branches/unordered/dev/libs/unordered/test/unordered/equality_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/equality_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/equality_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -38,41 +38,41 @@
         std::list<container_holder<T> > containers;
         container_holder<T> empty;
         containers.push_back(container_holder<T>());
- BOOST_TEST(empty.values == empty.values);
- BOOST_TEST(empty.values == containers.back().values);
- BOOST_TEST(empty.container == empty.container);
- BOOST_TEST(empty.container == containers.back().container);
+ BOOST_CHECK(empty.values == empty.values);
+ BOOST_CHECK(empty.values == containers.back().values);
+ BOOST_CHECK(empty.container == empty.container);
+ BOOST_CHECK(empty.container == containers.back().container);
 
         container_holder<T> one(1, generator);
         containers.push_back(one);
         
- BOOST_TEST(empty.values != one.values);
- BOOST_TEST(one.values == one.values);
- BOOST_TEST(one.values == containers.back().values);
- BOOST_TEST(empty.container != one.container);
- BOOST_TEST(one.container == one.container);
- BOOST_TEST(one.container == containers.back().container);
+ BOOST_CHECK(empty.values != one.values);
+ BOOST_CHECK(one.values == one.values);
+ BOOST_CHECK(one.values == containers.back().values);
+ BOOST_CHECK(empty.container != one.container);
+ BOOST_CHECK(one.container == one.container);
+ BOOST_CHECK(one.container == containers.back().container);
 
         container_holder<T> hundred(100, generator);
         container_holder<T> hundred2(100, generator);
- BOOST_TEST(hundred.values != hundred2.values);
+ BOOST_CHECK(hundred.values != hundred2.values);
 
         containers.push_back(hundred);
         containers.push_back(hundred2);
         
- BOOST_TEST(empty.values != hundred.values);
- BOOST_TEST(one.values != hundred.values);
- BOOST_TEST(hundred.values == hundred.values);
- BOOST_TEST(hundred2.values != hundred.values);
- BOOST_TEST(hundred.values == hundred.values);
- BOOST_TEST(hundred2.values == containers.back().values);
-
- BOOST_TEST(empty.container != hundred.container);
- BOOST_TEST(one.container != hundred.container);
- BOOST_TEST(hundred.container == hundred.container);
- BOOST_TEST(hundred2.container != hundred.container);
- BOOST_TEST(hundred.container == hundred.container);
- BOOST_TEST(hundred2.container == containers.back().container);
+ BOOST_CHECK(empty.values != hundred.values);
+ BOOST_CHECK(one.values != hundred.values);
+ BOOST_CHECK(hundred.values == hundred.values);
+ BOOST_CHECK(hundred2.values != hundred.values);
+ BOOST_CHECK(hundred.values == hundred.values);
+ BOOST_CHECK(hundred2.values == containers.back().values);
+
+ BOOST_CHECK(empty.container != hundred.container);
+ BOOST_CHECK(one.container != hundred.container);
+ BOOST_CHECK(hundred.container == hundred.container);
+ BOOST_CHECK(hundred2.container != hundred.container);
+ BOOST_CHECK(hundred.container == hundred.container);
+ BOOST_CHECK(hundred2.container == containers.back().container);
 
         for(std::size_t i = containers.size(); i < num_containers; ++i) {
             using namespace std;

Modified: branches/unordered/dev/libs/unordered/test/unordered/erase_equiv_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/erase_equiv_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/erase_equiv_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -67,11 +67,11 @@
 
     collide_map x(init.begin(), init.end());
     x.erase(x.begin(), x.begin());
- BOOST_TEST(x.count(1) == 1 && x.size() == 1);
+ BOOST_CHECK(x.count(1) == 1 && x.size() == 1);
     x.erase(x.end(), x.end());
- BOOST_TEST(x.count(1) == 1 && x.size() == 1);
+ BOOST_CHECK(x.count(1) == 1 && x.size() == 1);
     x.erase(x.begin(), x.end());
- BOOST_TEST(x.count(1) == 0 && x.size() == 0);
+ BOOST_CHECK(x.count(1) == 0 && x.size() == 0);
 }
 
 UNORDERED_AUTO_TEST(two_equivalent_item_tests)
@@ -83,14 +83,14 @@
     {
         collide_map x(init.begin(), init.end());
         x.erase(x.begin(), x.end());
- BOOST_TEST(x.count(1) == 0 && x.size() == 0);
+ BOOST_CHECK(x.count(1) == 0 && x.size() == 0);
     }
 
     {
         collide_map x(init.begin(), init.end());
         int value = boost::next(x.begin())->second;
         x.erase(x.begin(), boost::next(x.begin()));
- BOOST_TEST(x.count(1) == 1 && x.size() == 1 &&
+ BOOST_CHECK(x.count(1) == 1 && x.size() == 1 &&
             x.begin()->first == 1 && x.begin()->second == value);
     }
 
@@ -98,7 +98,7 @@
         collide_map x(init.begin(), init.end());
         int value = x.begin()->second;
         x.erase(boost::next(x.begin()), x.end());
- BOOST_TEST(x.count(1) == 1 && x.size() == 1 &&
+ BOOST_CHECK(x.count(1) == 1 && x.size() == 1 &&
                 x.begin()->first == 1 && x.begin()->second == value);
     }
 }

Modified: branches/unordered/dev/libs/unordered/test/unordered/erase_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/erase_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/erase_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -32,10 +32,10 @@
         {
             std::size_t count = x.count(test::get_key<Container>(*it));
             std::size_t old_size = x.size();
- BOOST_TEST(count == x.erase(test::get_key<Container>(*it)));
- BOOST_TEST(x.size() == old_size - count);
- BOOST_TEST(x.count(test::get_key<Container>(*it)) == 0);
- BOOST_TEST(x.find(test::get_key<Container>(*it)) == x.end());
+ BOOST_CHECK(count == x.erase(test::get_key<Container>(*it)));
+ BOOST_CHECK(x.size() == old_size - count);
+ BOOST_CHECK(x.count(test::get_key<Container>(*it)) == 0);
+ BOOST_CHECK(x.find(test::get_key<Container>(*it)) == x.end());
         }
     }
 
@@ -50,11 +50,11 @@
             std::size_t count = x.count(key);
             BOOST_DEDUCED_TYPENAME Container::iterator pos = x.erase(x.begin());
             --size;
- BOOST_TEST(pos == x.begin());
- BOOST_TEST(x.count(key) == count - 1);
- BOOST_TEST(x.size() == size);
+ BOOST_CHECK(pos == x.begin());
+ BOOST_CHECK(x.count(key) == count - 1);
+ BOOST_CHECK(x.size() == size);
         }
- BOOST_TEST(x.empty());
+ BOOST_CHECK(x.empty());
     }
 
     std::cerr<<"erase(random position).\n";
@@ -77,15 +77,15 @@
             next = boost::next(pos);
             BOOST_DEDUCED_TYPENAME Container::key_type key = test::get_key<Container>(*pos);
             std::size_t count = x.count(key);
- BOOST_TEST(next == x.erase(pos));
+ BOOST_CHECK(next == x.erase(pos));
             --size;
             if(size > 0)
- BOOST_TEST(index == 0 ? next == x.begin() :
+ BOOST_CHECK(index == 0 ? next == x.begin() :
                         next == boost::next(prev));
- BOOST_TEST(x.count(key) == count - 1);
- BOOST_TEST(x.size() == size);
+ BOOST_CHECK(x.count(key) == count - 1);
+ BOOST_CHECK(x.size() == size);
         }
- BOOST_TEST(x.empty());
+ BOOST_CHECK(x.empty());
     }
 
     std::cerr<<"erase(ranges).\n";
@@ -99,15 +99,15 @@
         // returns 'the iterator immediately following the erase elements'
         // and if nothing is erased, then there's nothing to follow. But I
         // think this is the only sensible option...
- BOOST_TEST(x.erase(x.end(), x.end()) == x.end());
- BOOST_TEST(x.erase(x.begin(), x.begin()) == x.begin());
- BOOST_TEST(x.size() == size);
-
- BOOST_TEST(x.erase(x.begin(), x.end()) == x.end());
- BOOST_TEST(x.empty());
- BOOST_TEST(x.begin() == x.end());
+ BOOST_CHECK(x.erase(x.end(), x.end()) == x.end());
+ BOOST_CHECK(x.erase(x.begin(), x.begin()) == x.begin());
+ BOOST_CHECK(x.size() == size);
+
+ BOOST_CHECK(x.erase(x.begin(), x.end()) == x.end());
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(x.begin() == x.end());
 
- BOOST_TEST(x.erase(x.begin(), x.end()) == x.begin());
+ BOOST_CHECK(x.erase(x.begin(), x.end()) == x.begin());
     }
 
     std::cerr<<"clear().\n";
@@ -115,8 +115,8 @@
         test::random_values<Container> v(500, generator);
         Container x(v.begin(), v.end());
         x.clear();
- BOOST_TEST(x.empty());
- BOOST_TEST(x.begin() == x.end());
+ BOOST_CHECK(x.empty());
+ BOOST_CHECK(x.begin() == x.end());
     }
 
     std::cerr<<"\n";

Modified: branches/unordered/dev/libs/unordered/test/unordered/find_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/find_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/find_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -34,12 +34,12 @@
             BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it1);
             iterator pos = x.find(key);
             BOOST_DEDUCED_TYPENAME X::const_iterator const_pos = x_const.find(key);
- BOOST_TEST(pos != x.end() &&
+ BOOST_CHECK(pos != x.end() &&
                     x.key_eq()(key, test::get_key<X>(*pos)));
- BOOST_TEST(const_pos != x_const.end() &&
+ BOOST_CHECK(const_pos != x_const.end() &&
                     x_const.key_eq()(key, test::get_key<X>(*const_pos)));
 
- BOOST_TEST(x.count(key) == tracker.count(key));
+ BOOST_CHECK(x.count(key) == tracker.count(key));
 
             test::compare_pairs(x.equal_range(key),
                     tracker.equal_range(key),
@@ -56,11 +56,11 @@
             BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it2);
             if(tracker.find(test::get_key<X>(key)) == tracker.end())
             {
- BOOST_TEST(x.find(key) == x.end());
- BOOST_TEST(x_const.find(key) == x_const.end());
- BOOST_TEST(x.count(key) == 0);
+ BOOST_CHECK(x.find(key) == x.end());
+ BOOST_CHECK(x_const.find(key) == x_const.end());
+ BOOST_CHECK(x.count(key) == 0);
                 std::pair<iterator, iterator> range = x.equal_range(key);
- BOOST_TEST(range.first == range.second);
+ BOOST_CHECK(range.first == range.second);
             }
         }
     }
@@ -73,10 +73,10 @@
                 v2.begin(); it3 != v2.end(); ++it3)
         {
             BOOST_DEDUCED_TYPENAME X::key_type key = test::get_key<X>(*it3);
- BOOST_TEST(x.find(key) == x.end());
- BOOST_TEST(x.count(key) == 0);
+ BOOST_CHECK(x.find(key) == x.end());
+ BOOST_CHECK(x.count(key) == 0);
             std::pair<iterator, iterator> range = x.equal_range(key);
- BOOST_TEST(range.first == range.second);
+ BOOST_CHECK(range.first == range.second);
         }
     }
 }

Modified: branches/unordered/dev/libs/unordered/test/unordered/insert_stable_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/insert_stable_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/insert_stable_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -47,13 +47,13 @@
     x.insert(insert_stable::member(1,3));
 
     boost::unordered_multiset<insert_stable::member>::const_iterator it = x.begin(), end = x.end();
- BOOST_TEST(it != end);
- if(it != end) { BOOST_TEST(it->tag2_ == 1); ++it; }
- BOOST_TEST(it != end);
- if(it != end) { BOOST_TEST(it->tag2_ == 2); ++it; }
- BOOST_TEST(it != end);
- if(it != end) { BOOST_TEST(it->tag2_ == 3); ++it; }
- BOOST_TEST(it == end);
+ BOOST_CHECK(it != end);
+ if(it != end) { BOOST_CHECK(it->tag2_ == 1); ++it; }
+ BOOST_CHECK(it != end);
+ if(it != end) { BOOST_CHECK(it->tag2_ == 2); ++it; }
+ BOOST_CHECK(it != end);
+ if(it != end) { BOOST_CHECK(it->tag2_ == 3); ++it; }
+ BOOST_CHECK(it == end);
 }
 
 UNORDERED_AUTO_TEST(stable_insert_test2) {
@@ -66,13 +66,13 @@
 
     it = x.begin();
     iterator end = x.end();
- BOOST_TEST(it != end);
- if(it != end) { BOOST_TEST(it->first.tag2_ == 1 && it->second == 1); ++it; }
- BOOST_TEST(it != end);
- if(it != end) { BOOST_TEST(it->first.tag2_ == 2 && it->second == 2); ++it; }
- BOOST_TEST(it != end);
- if(it != end) { BOOST_TEST(it->first.tag2_ == 3 && it->second == 3); ++it; }
- BOOST_TEST(it == end);
+ BOOST_CHECK(it != end);
+ if(it != end) { BOOST_CHECK(it->first.tag2_ == 1 && it->second == 1); ++it; }
+ BOOST_CHECK(it != end);
+ if(it != end) { BOOST_CHECK(it->first.tag2_ == 2 && it->second == 2); ++it; }
+ BOOST_CHECK(it != end);
+ if(it != end) { BOOST_CHECK(it->first.tag2_ == 3 && it->second == 3); ++it; }
+ BOOST_CHECK(it == end);
 }
 
 RUN_TESTS()

Modified: branches/unordered/dev/libs/unordered/test/unordered/insert_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/insert_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/insert_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -15,6 +15,8 @@
 #include "../helpers/input_iterator.hpp"
 
 #include <iostream>
+
+namespace insert_tests {
     
 test::seed_t seed(243432);
 
@@ -41,13 +43,13 @@
         std::pair<iterator, bool> r1 = x.insert(*it);
         std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 = tracker.insert(*it);
 
- BOOST_TEST(r1.second == r2.second);
- BOOST_TEST(*r1.first == *r2.first);
+ BOOST_CHECK(r1.second == r2.second);
+ BOOST_CHECK(*r1.first == *r2.first);
 
         tracker.compare_key(x, *it);
 
         if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
     }
 
     test::check_equivalent_keys(x);
@@ -71,12 +73,12 @@
         BOOST_DEDUCED_TYPENAME X::iterator r1 = x.insert(*it);
         BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 = tracker.insert(*it);
 
- BOOST_TEST(*r1 == *r2);
+ BOOST_CHECK(*r1 == *r2);
 
         tracker.compare_key(x, *it);
 
         if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
     }
 
     test::check_equivalent_keys(x);
@@ -105,11 +107,11 @@
 
             iterator r1 = x.insert(x.begin(), *it);
             tracker_iterator r2 = tracker.insert(tracker.begin(), *it);
- BOOST_TEST(*r1 == *r2);
+ BOOST_CHECK(*r1 == *r2);
             tracker.compare_key(x, *it);
 
             if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
         }
 
         test::check_equivalent_keys(x);
@@ -131,11 +133,11 @@
 
             const_iterator r1 = x.insert(x_const.end(), *it);
             tracker_iterator r2 = tracker.insert(tracker.end(), *it);
- BOOST_TEST(*r1 == *r2);
+ BOOST_CHECK(*r1 == *r2);
             tracker.compare_key(x, *it);
 
             if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
         }
 
         test::check_equivalent_keys(x);
@@ -157,11 +159,11 @@
 
             pos = x.insert(pos, *it);
             tracker_iterator r2 = tracker.insert(tracker.begin(), *it);
- BOOST_TEST(*pos == *r2);
+ BOOST_CHECK(*pos == *r2);
             tracker.compare_key(x, *it);
 
             if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
         }
 
         test::check_equivalent_keys(x);
@@ -185,7 +187,7 @@
             tracker.compare_key(x, *it);
 
             if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
         }
 
         test::check_equivalent_keys(x);
@@ -241,13 +243,13 @@
         std::pair<iterator, bool> r1 = x.emplace(*it);
         std::pair<BOOST_DEDUCED_TYPENAME ordered::iterator, bool> r2 = tracker.insert(*it);
 
- BOOST_TEST(r1.second == r2.second);
- BOOST_TEST(*r1.first == *r2.first);
+ BOOST_CHECK(r1.second == r2.second);
+ BOOST_CHECK(*r1.first == *r2.first);
 
         tracker.compare_key(x, *it);
 
         if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
     }
 
     test::check_equivalent_keys(x);
@@ -271,12 +273,12 @@
         BOOST_DEDUCED_TYPENAME X::iterator r1 = x.emplace(*it);
         BOOST_DEDUCED_TYPENAME test::ordered<X>::iterator r2 = tracker.insert(*it);
 
- BOOST_TEST(*r1 == *r2);
+ BOOST_CHECK(*r1 == *r2);
 
         tracker.compare_key(x, *it);
 
         if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
     }
 
     test::check_equivalent_keys(x);
@@ -305,7 +307,7 @@
         tracker.compare_key(x, *it);
 
         if(x.size() < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
     }
 
     test::check_equivalent_keys(x);
@@ -326,52 +328,53 @@
     test::check_equivalent_keys(x);
 }
 
-int main()
-{
- boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
- boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
- boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
- boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
-
- unique_insert_tests1(test_set);
- equivalent_insert_tests1(test_multiset);
- unique_insert_tests1(test_map);
- equivalent_insert_tests1(test_multimap);
-
- unique_insert_tests1(test_set, test::generate_collisions);
- equivalent_insert_tests1(test_multiset, test::generate_collisions);
- unique_insert_tests1(test_map, test::generate_collisions);
- equivalent_insert_tests1(test_multimap, test::generate_collisions);
-
- insert_tests2(test_set);
- insert_tests2(test_multiset);
- insert_tests2(test_map);
- insert_tests2(test_multimap);
-
- insert_tests2(test_set, test::generate_collisions);
- insert_tests2(test_multiset, test::generate_collisions);
- insert_tests2(test_map, test::generate_collisions);
- insert_tests2(test_multimap, test::generate_collisions);
+boost::unordered_set<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_set;
+boost::unordered_multiset<test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multiset;
+boost::unordered_map<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_map;
+boost::unordered_multimap<test::object, test::object, test::hash, test::equal_to, test::allocator<test::object> >* test_multimap;
+
+using test::default_generator;
+using test::generate_collisions;
+
+UNORDERED_TEST(unique_insert_tests1,
+ ((test_set)(test_map))
+ ((default_generator)(generate_collisions))
+)
+
+UNORDERED_TEST(equivalent_insert_tests1,
+ ((test_multiset)(test_multimap))
+ ((default_generator)(generate_collisions))
+)
+
+UNORDERED_TEST(insert_tests2,
+ ((test_set)(test_multiset)(test_map)(test_multimap))
+ ((default_generator)(generate_collisions))
+)
 
 #if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
- unique_emplace_tests1(test_set);
- equivalent_emplace_tests1(test_multiset);
- unique_emplace_tests1(test_map);
- equivalent_emplace_tests1(test_multimap);
-
- unique_emplace_tests1(test_set, test::generate_collisions);
- equivalent_emplace_tests1(test_multiset, test::generate_collisions);
- unique_emplace_tests1(test_map, test::generate_collisions);
- equivalent_emplace_tests1(test_multimap, test::generate_collisions);
-#endif
 
- map_tests(test_map);
- map_tests(test_map, test::generate_collisions);
+UNORDERED_TEST(unique_emplace_tests1,
+ ((test_set)(test_map))
+ ((default_generator)(generate_collisions))
+)
+
+UNORDERED_TEST(equivalent_emplace_tests1,
+ ((test_multiset)(test_multimap))
+ ((default_generator)(generate_collisions))
+)
 
- associative_insert_range_test(test_map);
- associative_insert_range_test(test_map, test::generate_collisions);
- associative_insert_range_test(test_multimap);
- associative_insert_range_test(test_multimap, test::generate_collisions);
+#endif
+
+UNORDERED_TEST(map_tests,
+ ((test_map))
+ ((default_generator)(generate_collisions))
+)
+
+UNORDERED_TEST(associative_insert_range_test,
+ ((test_map)(test_multimap))
+ ((default_generator)(generate_collisions))
+)
 
- return boost::report_errors();
 }
+
+RUN_TESTS()

Modified: branches/unordered/dev/libs/unordered/test/unordered/load_factor_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/load_factor_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/load_factor_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -24,13 +24,13 @@
 {
     X x;
 
- BOOST_TEST(x.max_load_factor() == 1.0);
- BOOST_TEST(x.load_factor() == 0);
+ BOOST_CHECK(x.max_load_factor() == 1.0);
+ BOOST_CHECK(x.load_factor() == 0);
 
     // A valid implementation could fail these tests, but I think they're
     // reasonable.
- x.max_load_factor(2.0); BOOST_TEST(x.max_load_factor() == 2.0);
- x.max_load_factor(0.5); BOOST_TEST(x.max_load_factor() == 0.5);
+ x.max_load_factor(2.0); BOOST_CHECK(x.max_load_factor() == 2.0);
+ x.max_load_factor(0.5); BOOST_CHECK(x.max_load_factor() == 0.5);
 }
 
 template <class X>
@@ -49,7 +49,7 @@
                  old_bucket_count = x.bucket_count();
         x.insert(*it);
         if(old_size + 1 < b * old_bucket_count)
- BOOST_TEST(x.bucket_count() == old_bucket_count);
+ BOOST_CHECK(x.bucket_count() == old_bucket_count);
     }
 }
 

Modified: branches/unordered/dev/libs/unordered/test/unordered/rehash_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/rehash_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/rehash_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -26,10 +26,10 @@
     X x;
 
     x.rehash(10000);
- BOOST_TEST(postcondition(x, 10000));
+ BOOST_CHECK(postcondition(x, 10000));
 
     x.rehash(0);
- BOOST_TEST(postcondition(x, 0));
+ BOOST_CHECK(postcondition(x, 0));
 }
 
 template <class X>
@@ -40,18 +40,18 @@
     tracker.insert_range(v.begin(), v.end());
     X x(v.begin(), v.end());
 
- x.rehash(0); BOOST_TEST(postcondition(x, 0));
+ x.rehash(0); BOOST_CHECK(postcondition(x, 0));
     tracker.compare(x);
 
     x.max_load_factor(0.25);
- x.rehash(0); BOOST_TEST(postcondition(x, 0));
+ x.rehash(0); BOOST_CHECK(postcondition(x, 0));
     tracker.compare(x);
 
     x.max_load_factor(50.0);
- x.rehash(0); BOOST_TEST(postcondition(x, 0));
+ x.rehash(0); BOOST_CHECK(postcondition(x, 0));
     tracker.compare(x);
 
- x.rehash(1000); BOOST_TEST(postcondition(x, 1000));
+ x.rehash(1000); BOOST_CHECK(postcondition(x, 1000));
     tracker.compare(x);
 }
 

Modified: branches/unordered/dev/libs/unordered/test/unordered/simple_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/simple_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/simple_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -19,67 +19,67 @@
 
     {
         X u;
- BOOST_TEST(u.size() == 0);
- BOOST_TEST(X().size() == 0);
+ BOOST_CHECK(u.size() == 0);
+ BOOST_CHECK(X().size() == 0);
     }
 
     {
- BOOST_TEST(equivalent(X(a)));
+ BOOST_CHECK(equivalent(X(a)));
     }
 
     {
         X u(a);
- BOOST_TEST(equivalent(u));
+ BOOST_CHECK(equivalent(u));
     }
 
     {
         X u = a;
- BOOST_TEST(equivalent(u));
+ BOOST_CHECK(equivalent(u));
     }
 
     {
         X b(a);
- BOOST_TEST(b.begin() == const_cast<X const&>(b).cbegin());
- BOOST_TEST(b.end() == const_cast<X const&>(b).cend());
+ BOOST_CHECK(b.begin() == const_cast<X const&>(b).cbegin());
+ BOOST_CHECK(b.end() == const_cast<X const&>(b).cend());
     }
 
     {
         X b(a);
         X c;
- BOOST_TEST(equivalent(b));
- BOOST_TEST(c.empty());
+ BOOST_CHECK(equivalent(b));
+ BOOST_CHECK(c.empty());
         b.swap(c);
- BOOST_TEST(b.empty());
- BOOST_TEST(equivalent(c));
+ BOOST_CHECK(b.empty());
+ BOOST_CHECK(equivalent(c));
         b.swap(c);
- BOOST_TEST(c.empty());
- BOOST_TEST(equivalent(b));
+ BOOST_CHECK(c.empty());
+ BOOST_CHECK(equivalent(b));
     }
 
     {
         X u;
         X& r = u;
- BOOST_TEST(&(r = r) == &r);
- BOOST_TEST(r.empty());
- BOOST_TEST(&(r = a) == &r);
- BOOST_TEST(equivalent(r));
- BOOST_TEST(&(r = r) == &r);
- BOOST_TEST(equivalent(r));
+ BOOST_CHECK(&(r = r) == &r);
+ BOOST_CHECK(r.empty());
+ BOOST_CHECK(&(r = a) == &r);
+ BOOST_CHECK(equivalent(r));
+ BOOST_CHECK(&(r = r) == &r);
+ BOOST_CHECK(equivalent(r));
     }
 
     {
- BOOST_TEST(a.size() ==
+ BOOST_CHECK(a.size() ==
                 (BOOST_DEDUCED_TYPENAME X::size_type) std::distance(a.begin(), a.end()));
     }
 
     {
- BOOST_TEST(a.empty() == (a.size() == 0));
+ BOOST_CHECK(a.empty() == (a.size() == 0));
     }
 
     {
- BOOST_TEST(a.empty() == (a.begin() == a.end()));
+ BOOST_CHECK(a.empty() == (a.begin() == a.end()));
         X u;
- BOOST_TEST(u.begin() == u.end());
+ BOOST_CHECK(u.begin() == u.end());
     }
 }
 

Modified: branches/unordered/dev/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- branches/unordered/dev/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ branches/unordered/dev/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2008-04-17 02:56:06 EDT (Thu, 17 Apr 2008)
@@ -44,9 +44,14 @@
         count_copies::count = 0;
         T x;
         BOOST_DEDUCED_TYPENAME T::value_type a;
- BOOST_TEST(count_copies::count == 1);
+ BOOST_CHECK(count_copies::count == 1);
+ if(count_copies::count != 1)
+ std::cerr<<count_copies::count<<" copies.\n";
+
         x.insert(a);
- BOOST_TEST(count_copies::count == 2);
+ BOOST_CHECK(count_copies::count == 2);
+ if(count_copies::count != 1)
+ std::cerr<<count_copies::count<<" copies.\n";
     }
 
     boost::unordered_set<count_copies>* set;


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