Boost logo

Boost-Commit :

From: joaquin_at_[hidden]
Date: 2007-11-19 06:08:11


Author: joaquin
Date: 2007-11-19 06:08:11 EST (Mon, 19 Nov 2007)
New Revision: 41220
URL: http://svn.boost.org/trac/boost/changeset/41220

Log:
moved some ADL stuff out of a potentially name-hiding scope
Text files modified:
   trunk/boost/multi_index/detail/auto_space.hpp | 13 ++++++++++---
   1 files changed, 10 insertions(+), 3 deletions(-)

Modified: trunk/boost/multi_index/detail/auto_space.hpp
==============================================================================
--- trunk/boost/multi_index/detail/auto_space.hpp (original)
+++ trunk/boost/multi_index/detail/auto_space.hpp 2007-11-19 06:08:11 EST (Mon, 19 Nov 2007)
@@ -65,8 +65,16 @@
 
   pointer data()const{return data_;}
 
- void swap(auto_space& x)
+ void swap(auto_space& x){swap_(x);}
+
+private:
+ 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)
@@ -80,8 +88,7 @@
     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_;


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