Skip to content

Commit 55bc631

Browse files
committed
Remove use of core/invoke_swap
1 parent 435b293 commit 55bc631

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

include/boost/array.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
#endif
4444

4545
#include <boost/assert.hpp>
46-
#include <boost/core/invoke_swap.hpp>
4746
#include <boost/static_assert.hpp>
4847
#include <boost/throw_exception.hpp>
4948
#include <algorithm>
5049
#include <iterator>
5150
#include <stdexcept>
51+
#include <utility>
5252
#include <cstddef>
5353

5454
namespace boost {
@@ -143,9 +143,9 @@ namespace boost {
143143
enum { static_size = N };
144144

145145
// swap (note: linear complexity)
146-
BOOST_CXX14_CONSTEXPR void swap (array<T,N>& y) {
147-
for (size_type i = 0; i < N; ++i)
148-
boost::core::invoke_swap(elems[i],y.elems[i]);
146+
BOOST_CXX14_CONSTEXPR void swap (array<T,N>& y)
147+
{
148+
std::swap( elems, y.elems );
149149
}
150150

151151
// direct access to data
@@ -264,7 +264,8 @@ namespace boost {
264264
static BOOST_CONSTEXPR size_type max_size() BOOST_NOEXCEPT { return 0; }
265265
enum { static_size = 0 };
266266

267-
void swap (array<T,0>& /*y*/) {
267+
BOOST_CXX14_CONSTEXPR void swap (array<T,0>& /*y*/)
268+
{
268269
}
269270

270271
// direct access to data
@@ -370,7 +371,7 @@ namespace boost {
370371

371372
// global swap()
372373
template<class T, std::size_t N>
373-
inline void swap (array<T,N>& x, array<T,N>& y) {
374+
BOOST_CXX14_CONSTEXPR inline void swap (array<T,N>& x, array<T,N>& y) {
374375
x.swap(y);
375376
}
376377

0 commit comments

Comments
 (0)