Ticket #2753: array_swap_by_boost_swap.patch
File array_swap_by_boost_swap.patch, 683 bytes (added by , 14 years ago) |
---|
-
array.hpp
27 27 #include <cstddef> 28 28 #include <stdexcept> 29 29 #include <boost/assert.hpp> 30 #include <boost/swap.hpp> 30 31 31 32 // Handles broken standard libraries better than <iterator> 32 33 #include <boost/detail/iterator.hpp> … … 131 132 132 133 // swap (note: linear complexity) 133 134 void swap (array<T,N>& y) { 134 std::swap_ranges(begin(),end(),y.begin()); 135 for (size_type i = 0; i < N; ++i) 136 boost::swap(elems[i],y.elems[i]); 135 137 } 136 138 137 139 // direct access to data (read-only)