forked from boostorg/array
Remove use of core/invoke_swap
This commit is contained in:
@ -43,12 +43,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/core/invoke_swap.hpp>
|
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <utility>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
@ -143,9 +143,9 @@ namespace boost {
|
|||||||
enum { static_size = N };
|
enum { static_size = N };
|
||||||
|
|
||||||
// swap (note: linear complexity)
|
// swap (note: linear complexity)
|
||||||
BOOST_CXX14_CONSTEXPR void swap (array<T,N>& y) {
|
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]);
|
std::swap( elems, y.elems );
|
||||||
}
|
}
|
||||||
|
|
||||||
// direct access to data
|
// direct access to data
|
||||||
@ -264,7 +264,8 @@ namespace boost {
|
|||||||
static BOOST_CONSTEXPR size_type max_size() BOOST_NOEXCEPT { return 0; }
|
static BOOST_CONSTEXPR size_type max_size() BOOST_NOEXCEPT { return 0; }
|
||||||
enum { static_size = 0 };
|
enum { static_size = 0 };
|
||||||
|
|
||||||
void swap (array<T,0>& /*y*/) {
|
BOOST_CXX14_CONSTEXPR void swap (array<T,0>& /*y*/)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// direct access to data
|
// direct access to data
|
||||||
@ -370,7 +371,7 @@ namespace boost {
|
|||||||
|
|
||||||
// global swap()
|
// global swap()
|
||||||
template<class T, std::size_t N>
|
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);
|
x.swap(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user