Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72608 - in sandbox/bloom_filter/trunk/boost/bloom_filter: . hash
From: cpp.cabrera_at_[hidden]
Date: 2011-06-15 20:55:11


Author: alejandro
Date: 2011-06-15 20:55:10 EDT (Wed, 15 Jun 2011)
New Revision: 72608
URL: http://svn.boost.org/trac/boost/changeset/72608

Log:
Added static modifier to size and num_hash_functions functions. Changed implementation of default hash function to use hash_value + Seed instead of hash_range.
Text files modified:
   sandbox/bloom_filter/trunk/boost/bloom_filter/bloom.hpp | 11 +++++++----
   sandbox/bloom_filter/trunk/boost/bloom_filter/hash/default.hpp | 4 +---
   2 files changed, 8 insertions(+), 7 deletions(-)

Modified: sandbox/bloom_filter/trunk/boost/bloom_filter/bloom.hpp
==============================================================================
--- sandbox/bloom_filter/trunk/boost/bloom_filter/bloom.hpp (original)
+++ sandbox/bloom_filter/trunk/boost/bloom_filter/bloom.hpp 2011-06-15 20:55:10 EDT (Wed, 15 Jun 2011)
@@ -32,17 +32,20 @@
     template <typename T,
               size_t Size,
               class HashFunctions = mpl::vector<boost_hash<T, 3>,
- boost_hash<T, 5>,
- boost_hash<T, 7> > >
+ boost_hash<T, 37> > >
     class bloom_filter {
     public:
+ typedef T value_type;
+ typedef T key_type;
+
+ public:
       bloom_filter() {}
 
- BOOST_CONSTEXPR size_t size() const {
+ static BOOST_CONSTEXPR size_t size() const {
         return Size;
       }
 
- BOOST_CONSTEXPR size_t num_hash_functions() const {
+ static BOOST_CONSTEXPR size_t num_hash_functions() const {
         return mpl::size<HashFunctions>::value;
       };
 

Modified: sandbox/bloom_filter/trunk/boost/bloom_filter/hash/default.hpp
==============================================================================
--- sandbox/bloom_filter/trunk/boost/bloom_filter/hash/default.hpp (original)
+++ sandbox/bloom_filter/trunk/boost/bloom_filter/hash/default.hpp 2011-06-15 20:55:10 EDT (Wed, 15 Jun 2011)
@@ -23,9 +23,7 @@
   template <typename T, size_t Seed>
     struct boost_hash {
       size_t operator()(const T& t) {
- size_t seed = Seed;
- boost::hash_combine(seed, t);
- return seed;
+ return boost::hash_value(t) + Seed;
       }
     };
   }


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