Boost logo

Boost-Commit :

From: joaquin_at_[hidden]
Date: 2007-11-30 16:09:14


Author: joaquin
Date: 2007-11-30 16:09:14 EST (Fri, 30 Nov 2007)
New Revision: 41513
URL: http://svn.boost.org/trac/boost/changeset/41513

Log:
merged rev. 41397 from trunk
Added:
   branches/release/boost/multi_index/detail/adl_swap.hpp
      - copied unchanged from r41512, /trunk/boost/multi_index/detail/adl_swap.hpp
Text files modified:
   branches/release/boost/multi_index/detail/auto_space.hpp | 25 +++++--------------------
   branches/release/boost/multi_index_container.hpp | 10 ++--------
   2 files changed, 7 insertions(+), 28 deletions(-)

Modified: branches/release/boost/multi_index/detail/auto_space.hpp
==============================================================================
--- branches/release/boost/multi_index/detail/auto_space.hpp (original)
+++ branches/release/boost/multi_index/detail/auto_space.hpp 2007-11-30 16:09:14 EST (Fri, 30 Nov 2007)
@@ -16,6 +16,7 @@
 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
 #include <algorithm>
 #include <boost/detail/allocator_utilities.hpp>
+#include <boost/multi_index/detail/adl_swap.hpp>
 #include <boost/multi_index/detail/prevent_eti.hpp>
 #include <boost/noncopyable.hpp>
 #include <memory>
@@ -65,30 +66,14 @@
 
   pointer data()const{return data_;}
 
- void swap(auto_space& x){swap_(x);}
-
-private:
- void swap_(auto_space& x)
+ void swap(auto_space& x)
   {
- /* Swapping is done inside swap_() rather than swap() so as to avoid
- * name hiding when ADLing swap below. Not sure if this is legally
- * required, though.
- */
-
- if(al_!=x.al_){
-
-#if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
- std::swap(al_,x.al_);
-#else
- using std::swap;
- swap(al_,x.al_);
-#endif
-
- }
+ if(al_!=x.al_)adl_swap(al_,x.al_);
     std::swap(n_,x.n_);
     std::swap(data_,x.data_);
   }
-
+
+private:
   typename boost::detail::allocator::rebind_to<
     Allocator,T>::type al_;
   std::size_t n_;

Modified: branches/release/boost/multi_index_container.hpp
==============================================================================
--- branches/release/boost/multi_index_container.hpp (original)
+++ branches/release/boost/multi_index_container.hpp 2007-11-30 16:09:14 EST (Fri, 30 Nov 2007)
@@ -29,6 +29,7 @@
 #include <boost/mpl/deref.hpp>
 #include <boost/multi_index_container_fwd.hpp>
 #include <boost/multi_index/detail/access_specifier.hpp>
+#include <boost/multi_index/detail/adl_swap.hpp>
 #include <boost/multi_index/detail/base_type.hpp>
 #include <boost/multi_index/detail/converter.hpp>
 #include <boost/multi_index/detail/header_holder.hpp>
@@ -540,14 +541,7 @@
   void swap_(multi_index_container<Value,IndexSpecifierList,Allocator>& x)
   {
     if(bfm_allocator::member!=x.bfm_allocator::member){
-
-#if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
- std::swap(bfm_allocator::member,x.bfm_allocator::member);
-#else
- using std::swap;
- swap(bfm_allocator::member,x.bfm_allocator::member);
-#endif
-
+ detail::adl_swap(bfm_allocator::member,x.bfm_allocator::member);
     }
     std::swap(bfm_header::member,x.bfm_header::member);
     super::swap_(x);


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