Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-05-24 06:55:46


Author: danieljames
Date: 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
New Revision: 45708
URL: http://svn.boost.org/trac/boost/changeset/45708

Log:
Merge latest changes from trunk - Borland fixes + improved documentation.

Merged revisions 45575-45707 via svnmerge from
https://svn.boost.org/svn/boost/trunk

Properties modified:
   branches/unordered/trunk/ (props changed)
Text files modified:
   branches/unordered/trunk/boost/unordered/detail/hash_table.hpp | 8 ++++++--
   branches/unordered/trunk/libs/functional/hash/doc/Jamfile.v2 | 2 ++
   branches/unordered/trunk/libs/functional/hash/doc/ref.xml | 7 +++++++
   branches/unordered/trunk/libs/unordered/test/unordered/bucket_tests.cpp | 4 ++--
   branches/unordered/trunk/libs/unordered/test/unordered/load_factor_tests.cpp | 4 ++--
   branches/unordered/trunk/libs/unordered/test/unordered/rehash_tests.cpp | 12 ++++--------
   6 files changed, 23 insertions(+), 14 deletions(-)

Modified: branches/unordered/trunk/boost/unordered/detail/hash_table.hpp
==============================================================================
--- branches/unordered/trunk/boost/unordered/detail/hash_table.hpp (original)
+++ branches/unordered/trunk/boost/unordered/detail/hash_table.hpp 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
@@ -81,6 +81,7 @@
         template<typename T> struct prime_list_template
         {
             static std::size_t const value[];
+ static std::ptrdiff_t const length;
         };
 
         template<typename T>
@@ -92,13 +93,16 @@
             50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
             1610612741ul, 3221225473ul, 4294967291ul };
 
+ template<typename T>
+ std::ptrdiff_t const prime_list_template<T>::length = 28;
+
         typedef prime_list_template<std::size_t> prime_list;
 
         // no throw
         inline std::size_t next_prime(std::size_t n) {
             std::size_t const* const prime_list_begin = prime_list::value;
             std::size_t const* const prime_list_end = prime_list_begin +
- sizeof(prime_list::value) / sizeof(*prime_list::value);
+ prime_list::length;
             std::size_t const* bound =
                 std::lower_bound(prime_list_begin, prime_list_end, n);
             if(bound == prime_list_end)
@@ -110,7 +114,7 @@
         inline std::size_t prev_prime(std::size_t n) {
             std::size_t const* const prime_list_begin = prime_list::value;
             std::size_t const* const prime_list_end = prime_list_begin +
- sizeof(prime_list::value) / sizeof(*prime_list::value);
+ prime_list::length;
             std::size_t const* bound =
                 std::upper_bound(prime_list_begin,prime_list_end, n);
             if(bound != prime_list_begin)

Modified: branches/unordered/trunk/libs/functional/hash/doc/Jamfile.v2
==============================================================================
--- branches/unordered/trunk/libs/functional/hash/doc/Jamfile.v2 (original)
+++ branches/unordered/trunk/libs/functional/hash/doc/Jamfile.v2 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
@@ -8,6 +8,8 @@
     <xsl:param>admon.graphics.path=images/
     <xsl:param>navig.graphics.path=images/
     <xsl:param>html.stylesheet=boostbook.css
+ <xsl:param>boost.root=../../../../..
+ <xsl:param>boost.libraries=../../../../libraries.htm
     <xsl:param>chunk.first.sections=1
     <xsl:param>chunk.section.depth=2
     <xsl:param>generate.section.toc.level=2

Modified: branches/unordered/trunk/libs/functional/hash/doc/ref.xml
==============================================================================
--- branches/unordered/trunk/libs/functional/hash/doc/ref.xml (original)
+++ branches/unordered/trunk/libs/functional/hash/doc/ref.xml 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
@@ -406,6 +406,8 @@
         </method>
       </struct-specialization>
 
+ <free-function-group name="Support functions (Boost extension).">
+
       <!--
         boost::hash_combine
         -->
@@ -500,6 +502,10 @@
         </para></throws>
       </overloaded-function>
 
+ </free-function-group>
+
+ <free-function-group name="Overloadable hash implementation (Boost extension).">
+
       <!--
         boost::hash_value - integers
         -->
@@ -797,6 +803,7 @@
           </informaltable>
         </returns>
       </overloaded-function>
+ </free-function-group>
     </namespace>
   </header>
 </library-reference>

Modified: branches/unordered/trunk/libs/unordered/test/unordered/bucket_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/bucket_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/bucket_tests.cpp 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
@@ -16,7 +16,7 @@
 test::seed_t seed(54635);
 
 template <class X>
-void bucket_tests(X* = 0)
+void tests(X* = 0)
 {
     typedef BOOST_DEDUCED_TYPENAME X::size_type size_type;
     typedef BOOST_DEDUCED_TYPENAME X::const_local_iterator const_local_iterator;
@@ -55,7 +55,7 @@
 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;
 
-UNORDERED_TEST(bucket_tests, ((test_set)(test_multiset)(test_map)(test_multimap)))
+UNORDERED_TEST(tests, ((test_set)(test_multiset)(test_map)(test_multimap)))
 
 }
 

Modified: branches/unordered/trunk/libs/unordered/test/unordered/load_factor_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/load_factor_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/load_factor_tests.cpp 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
@@ -20,7 +20,7 @@
 test::seed_t seed(783656);
 
 template <class X>
-void load_factor_tests(X* = 0)
+void set_load_factor_tests(X* = 0)
 {
     X x;
 
@@ -71,7 +71,7 @@
 boost::unordered_map<int, int>* int_map_ptr;
 boost::unordered_multimap<int, int>* int_multimap_ptr;
 
-UNORDERED_TEST(load_factor_tests,
+UNORDERED_TEST(set_load_factor_tests,
     ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
 )
 

Modified: branches/unordered/trunk/libs/unordered/test/unordered/rehash_tests.cpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/unordered/rehash_tests.cpp (original)
+++ branches/unordered/trunk/libs/unordered/test/unordered/rehash_tests.cpp 2008-05-24 06:55:45 EDT (Sat, 24 May 2008)
@@ -55,19 +55,15 @@
     tracker.compare(x);
 }
 
-template <class X>
-void rehash_tests(X* ptr = 0)
-{
- rehash_empty_test1(ptr);
- rehash_test1(ptr);
-}
-
 boost::unordered_set<int>* int_set_ptr;
 boost::unordered_multiset<int>* int_multiset_ptr;
 boost::unordered_map<int, int>* int_map_ptr;
 boost::unordered_multimap<int, int>* int_multimap_ptr;
 
-UNORDERED_TEST(rehash_tests,
+UNORDERED_TEST(rehash_empty_test1,
+ ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
+)
+UNORDERED_TEST(rehash_test1,
     ((int_set_ptr)(int_multiset_ptr)(int_map_ptr)(int_multimap_ptr))
 )
 


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