Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72730 - sandbox/bloom_filter/trunk/boost/bloom_filter
From: cpp.cabrera_at_[hidden]
Date: 2011-06-24 04:27:35


Author: alejandro
Date: 2011-06-24 04:27:34 EDT (Fri, 24 Jun 2011)
New Revision: 72730
URL: http://svn.boost.org/trac/boost/changeset/72730

Log:
Added global and member swap.
Text files modified:
   sandbox/bloom_filter/trunk/boost/bloom_filter/bloom.hpp | 20 +++++++++++++++++---
   1 files changed, 17 insertions(+), 3 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-24 04:27:34 EDT (Fri, 24 Jun 2011)
@@ -45,14 +45,14 @@
       bloom_filter() {}
 
       template <typename InputIterator>
- bloom_filter (const InputIterator start, const InputIterator end) {
+ bloom_filter(const InputIterator start, const InputIterator end) {
         for (InputIterator i = start; i != end; ++i)
           this->insert(*i);
       }
 
 #ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST
- bloom_filter (std::initializer_list<T> ilist) {
- typedef std::initializer_list::const_iterator citer;
+ bloom_filter(std::initializer_list<T> ilist) {
+ typedef typename std::initializer_list<T>::const_iterator citer;
         for (citer i = ilist.begin(), end = ilist.end(); i != end; ++i) {
           this->insert(*i);
         }
@@ -105,6 +105,12 @@
         this->bits.reset();
       }
 
+ void swap(bloom_filter& other) {
+ bloom_filter tmp = other;
+ other = *this;
+ *this = tmp;
+ }
+
       bloom_filter& operator|=(const bloom_filter& rhs) {
         this->bits |= rhs.bits;
         return *this;
@@ -138,6 +144,14 @@
       ret &= rhs;
       return ret;
     }
+
+ template<class _T, size_t _Size, class _HashFunctions>
+ void
+ swap(bloom_filter<_T, _Size, _HashFunctions>& lhs,
+ bloom_filter<_T, _Size, _HashFunctions>& rhs)
+ {
+ lhs.swap(rhs);
+ }
   } // namespace bloom_filter
 } // namespace boost
 #endif


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