Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52746 - in sandbox/move: boost/unordered/detail libs/unordered/test/helpers
From: daniel_james_at_[hidden]
Date: 2009-05-03 06:12:31


Author: danieljames
Date: 2009-05-03 06:12:30 EDT (Sun, 03 May 2009)
New Revision: 52746
URL: http://svn.boost.org/trac/boost/changeset/52746

Log:
Merge latest unordered container changes.
Text files modified:
   sandbox/move/boost/unordered/detail/hash_table.hpp | 25 +++++++++++++++++--------
   sandbox/move/libs/unordered/test/helpers/count.hpp | 7 +++++++
   2 files changed, 24 insertions(+), 8 deletions(-)

Modified: sandbox/move/boost/unordered/detail/hash_table.hpp
==============================================================================
--- sandbox/move/boost/unordered/detail/hash_table.hpp (original)
+++ sandbox/move/boost/unordered/detail/hash_table.hpp 2009-05-03 06:12:30 EDT (Sun, 03 May 2009)
@@ -35,6 +35,8 @@
 #include <boost/mpl/not.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/utility/swap.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
 
 #include <boost/mpl/aux_/config/eti.hpp>
 
@@ -72,18 +74,25 @@
             static std::ptrdiff_t const length;
         };
 
+#define BOOST_UNORDERED_PRIMES \
+ (5ul)(11ul)(17ul)(29ul)(37ul)(53ul)(67ul)(79ul) \
+ (97ul)(131ul)(193ul)(257ul)(389ul)(521ul)(769ul) \
+ (1031ul)(1543ul)(2053ul)(3079ul)(6151ul)(12289ul)(24593ul) \
+ (49157ul)(98317ul)(196613ul)(393241ul)(786433ul) \
+ (1572869ul)(3145739ul)(6291469ul)(12582917ul)(25165843ul) \
+ (50331653ul)(100663319ul)(201326611ul)(402653189ul)(805306457ul) \
+ (1610612741ul)(3221225473ul)(4294967291ul)
+
         template<typename T>
         std::size_t const prime_list_template<T>::value[] = {
- 5ul, 11ul, 17ul, 29ul, 37ul, 53ul, 67ul, 79ul,
- 97ul, 131ul, 193ul, 257ul, 389ul, 521ul, 769ul,
- 1031ul, 1543ul, 2053ul, 3079ul, 6151ul, 12289ul, 24593ul,
- 49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
- 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
- 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
- 1610612741ul, 3221225473ul, 4294967291ul };
+ BOOST_PP_SEQ_ENUM(BOOST_UNORDERED_PRIMES)
+ };
 
         template<typename T>
- std::ptrdiff_t const prime_list_template<T>::length = 28;
+ std::ptrdiff_t const prime_list_template<T>::length
+ = BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES);
+
+#undef BOOST_UNORDERED_PRIMES
 
         typedef prime_list_template<std::size_t> prime_list;
 

Modified: sandbox/move/libs/unordered/test/helpers/count.hpp
==============================================================================
--- sandbox/move/libs/unordered/test/helpers/count.hpp (original)
+++ sandbox/move/libs/unordered/test/helpers/count.hpp 2009-05-03 06:12:30 EDT (Sun, 03 May 2009)
@@ -6,6 +6,8 @@
 #if !defined(BOOST_UNORDERED_TEST_HELPERS_COUNT_HEAD)
 #define BOOST_UNORDERED_TEST_HELPERS_COUNT_HEAD
 
+#include <iostream>
+
 namespace test {
     struct object_count {
         int instances;
@@ -36,6 +38,11 @@
         bool operator!=(object_count const& x) const {
             return !(*this == x);
         }
+
+ friend std::ostream& operator<<(std::ostream& out, object_count const& c) {
+ out<<"[instances: "<<c.instances<<", constructions: "<<c.constructions<<"]";
+ return out;
+ }
     };
 
     template <class T>


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