Skip to content

Commit

Permalink
Switch to boost::core::invoke_swap.
Browse files Browse the repository at this point in the history
boost::swap is deprecated and will be removed. Use boost::core::invoke_swap
as a replacement.
  • Loading branch information
Lastique committed Sep 2, 2023
1 parent 7ddeff5 commit 62d6367
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/boost/log/sources/severity_feature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <boost/cstdint.hpp>
#include <boost/static_assert.hpp>
#include <boost/core/swap.hpp>
#include <boost/core/invoke_swap.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
Expand Down Expand Up @@ -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);
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <algorithm>
#include <boost/cstdint.hpp>
#include <boost/assert.hpp>
#include <boost/core/swap.hpp>
#include <boost/core/invoke_swap.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
Expand Down Expand Up @@ -61,15 +61,15 @@ 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;
while (it != end)
{
Iterator where = begin + rng() % (it - begin + 1u);
if (where != it)
boost::swap(*where, *it);
boost::core::invoke_swap(*where, *it);
++it;
}
}
Expand Down

0 comments on commit 62d6367

Please sign in to comment.