From 62d63678ae0edd192e81d8785678898091bafce9 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 3 Sep 2023 02:30:41 +0300 Subject: [PATCH] Switch to boost::core::invoke_swap. boost::swap is deprecated and will be removed. Use boost::core::invoke_swap as a replacement. --- include/boost/log/sources/severity_feature.hpp | 4 ++-- src/core.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/log/sources/severity_feature.hpp b/include/boost/log/sources/severity_feature.hpp index e798fb0dde..2fdd21235e 100644 --- a/include/boost/log/sources/severity_feature.hpp +++ b/include/boost/log/sources/severity_feature.hpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -261,7 +261,7 @@ class basic_severity_logger : void swap_unlocked(basic_severity_logger& that) { base_type::swap_unlocked(static_cast< base_type& >(that)); - boost::swap(m_DefaultSeverity, that.m_DefaultSeverity); + boost::core::invoke_swap(m_DefaultSeverity, that.m_DefaultSeverity); m_SeverityAttr.swap(that.m_SeverityAttr); } }; diff --git a/src/core.cpp b/src/core.cpp index 4fe27c7eea..657de0eb8d 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ BOOST_LOG_ANONYMOUS_NAMESPACE { //! Sequence shuffling algorithm. Very similar to std::random_shuffle, used for forward portability with compilers that removed it from the standard library (C++17). template< typename Iterator, typename RandomNumberGenerator > -void random_shuffle(Iterator begin, Iterator end, RandomNumberGenerator& rng) +inline void random_shuffle(Iterator begin, Iterator end, RandomNumberGenerator& rng) { Iterator it = begin; ++it; @@ -69,7 +69,7 @@ void random_shuffle(Iterator begin, Iterator end, RandomNumberGenerator& rng) { Iterator where = begin + rng() % (it - begin + 1u); if (where != it) - boost::swap(*where, *it); + boost::core::invoke_swap(*where, *it); ++it; } }