From 55bc631d40d369347961e2e845fbdfc7f23e17c1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 26 Jan 2025 04:08:06 +0200 Subject: [PATCH] Remove use of core/invoke_swap --- include/boost/array.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/boost/array.hpp b/include/boost/array.hpp index f0ebd9d..b54cf06 100644 --- a/include/boost/array.hpp +++ b/include/boost/array.hpp @@ -43,12 +43,12 @@ #endif #include -#include #include #include #include #include #include +#include #include namespace boost { @@ -143,9 +143,9 @@ namespace boost { enum { static_size = N }; // swap (note: linear complexity) - BOOST_CXX14_CONSTEXPR void swap (array& y) { - for (size_type i = 0; i < N; ++i) - boost::core::invoke_swap(elems[i],y.elems[i]); + BOOST_CXX14_CONSTEXPR void swap (array& y) + { + std::swap( elems, y.elems ); } // direct access to data @@ -264,7 +264,8 @@ namespace boost { static BOOST_CONSTEXPR size_type max_size() BOOST_NOEXCEPT { return 0; } enum { static_size = 0 }; - void swap (array& /*y*/) { + BOOST_CXX14_CONSTEXPR void swap (array& /*y*/) + { } // direct access to data @@ -370,7 +371,7 @@ namespace boost { // global swap() template - inline void swap (array& x, array& y) { + BOOST_CXX14_CONSTEXPR inline void swap (array& x, array& y) { x.swap(y); }