Skip to content

Commit

Permalink
Remove use of core/invoke_swap
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 26, 2025
1 parent 435b293 commit 55bc631
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions include/boost/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
#endif

#include <boost/assert.hpp>
#include <boost/core/invoke_swap.hpp>
#include <boost/static_assert.hpp>
#include <boost/throw_exception.hpp>
#include <algorithm>
#include <iterator>
#include <stdexcept>
#include <utility>
#include <cstddef>

namespace boost {
Expand Down Expand Up @@ -143,9 +143,9 @@ namespace boost {
enum { static_size = N };

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

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

void swap (array<T,0>& /*y*/) {
BOOST_CXX14_CONSTEXPR void swap (array<T,0>& /*y*/)
{
}

// direct access to data
Expand Down Expand Up @@ -370,7 +371,7 @@ namespace boost {

// global swap()
template<class T, std::size_t N>
inline void swap (array<T,N>& x, array<T,N>& y) {
BOOST_CXX14_CONSTEXPR inline void swap (array<T,N>& x, array<T,N>& y) {
x.swap(y);
}

Expand Down

0 comments on commit 55bc631

Please sign in to comment.