Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72843 - sandbox/bloom_filter/trunk/boost/bloom_filter
From: cpp.cabrera_at_[hidden]
Date: 2011-07-02 04:06:29


Author: alejandro
Date: 2011-07-02 04:06:28 EDT (Sat, 02 Jul 2011)
New Revision: 72843
URL: http://svn.boost.org/trac/boost/changeset/72843

Log:
Added operator== and operator!= to static Bloom filter.
Text files modified:
   sandbox/bloom_filter/trunk/boost/bloom_filter/bloom.hpp | 26 ++++++++++++++++++++++++++
   1 files changed, 26 insertions(+), 0 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-07-02 04:06:28 EDT (Sat, 02 Jul 2011)
@@ -121,11 +121,37 @@
         return *this;
       }
 
+ template<class _T, size_t _Size, class _HashFunctions>
+ friend bool
+ operator==(const bloom_filter<_T, _Size, _HashFunctions>&,
+ const bloom_filter<_T, _Size, _HashFunctions>&);
+
+ template<class _T, size_t _Size, class _HashFunctions>
+ friend bool
+ operator!=(const bloom_filter<_T, _Size, _HashFunctions>&,
+ const bloom_filter<_T, _Size, _HashFunctions>&);
+
     private:
       std::bitset<Size> bits;
     };
 
     template<class _T, size_t _Size, class _HashFunctions>
+ bool
+ operator==(const bloom_filter<_T, _Size, _HashFunctions>& lhs,
+ const bloom_filter<_T, _Size, _HashFunctions>& rhs)
+ {
+ return (lhs.bits == rhs.bits);
+ }
+
+ template<class _T, size_t _Size, class _HashFunctions>
+ bool
+ operator!=(const bloom_filter<_T, _Size, _HashFunctions>& lhs,
+ const bloom_filter<_T, _Size, _HashFunctions>& rhs)
+ {
+ return !(lhs == rhs);
+ }
+
+ template<class _T, size_t _Size, class _HashFunctions>
     bloom_filter<_T, _Size, _HashFunctions>
     operator|(const bloom_filter<_T, _Size, _HashFunctions>& lhs,
               const bloom_filter<_T, _Size, _HashFunctions>& rhs)


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