Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53104 - trunk/boost
From: steven_at_[hidden]
Date: 2009-05-18 22:37:05


Author: steven_watanabe
Date: 2009-05-18 22:37:04 EDT (Mon, 18 May 2009)
New Revision: 53104
URL: http://svn.boost.org/trac/boost/changeset/53104

Log:
Use boost::swap instead of std::swap_ranges to enable ADL. Fixes #2753.
Text files modified:
   trunk/boost/array.hpp | 4 +++-
   1 files changed, 3 insertions(+), 1 deletions(-)

Modified: trunk/boost/array.hpp
==============================================================================
--- trunk/boost/array.hpp (original)
+++ trunk/boost/array.hpp 2009-05-18 22:37:04 EDT (Mon, 18 May 2009)
@@ -27,6 +27,7 @@
 #include <cstddef>
 #include <stdexcept>
 #include <boost/assert.hpp>
+#include <boost/swap.hpp>
 
 // Handles broken standard libraries better than <iterator>
 #include <boost/detail/iterator.hpp>
@@ -131,7 +132,8 @@
 
         // swap (note: linear complexity)
         void swap (array<T,N>& y) {
- std::swap_ranges(begin(),end(),y.begin());
+ for (size_type i = 0; i < N; ++i)
+ boost::swap(elems[i],y.elems[i]);
         }
 
         // direct access to data (read-only)


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