mirror of
https://git.suyu.dev/suyu/ext-boost.git
synced 2025-12-24 00:04:41 +01:00
Update to boost v1.63.0
This commit is contained in:
parent
f005c955f8
commit
25db91d480
535 changed files with 20797 additions and 37185 deletions
|
|
@ -22,9 +22,8 @@
|
|||
|
||||
//Based on Boost.Core's swap.
|
||||
//Many thanks to Steven Watanabe, Joseph Gauterin and Niels Dekker.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <cstddef> //for std::size_t
|
||||
#include <boost/move/detail/workaround.hpp> //forceinline
|
||||
|
||||
//Try to avoid including <algorithm>, as it's quite big
|
||||
#if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB)
|
||||
|
|
@ -156,7 +155,7 @@ struct and_op_not
|
|||
{};
|
||||
|
||||
template<class T>
|
||||
void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c<!boost::move_detail::has_move_emulation_enabled_impl<T>::value>::type* = 0)
|
||||
BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c<!boost::move_detail::has_move_emulation_enabled_impl<T>::value>::type* = 0)
|
||||
{
|
||||
//use std::swap if argument dependent lookup fails
|
||||
//Use using directive ("using namespace xxx;") instead as some older compilers
|
||||
|
|
@ -166,14 +165,14 @@ void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c<!boost::mov
|
|||
}
|
||||
|
||||
template<class T>
|
||||
void swap_proxy(T& x, T& y
|
||||
BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y
|
||||
, typename boost::move_detail::enable_if< and_op_not_impl<boost::move_detail::has_move_emulation_enabled_impl<T>
|
||||
, boost_move_member_swap::has_member_swap<T> >
|
||||
>::type* = 0)
|
||||
{ T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t); }
|
||||
|
||||
template<class T>
|
||||
void swap_proxy(T& x, T& y
|
||||
BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y
|
||||
, typename boost::move_detail::enable_if< and_op_impl< boost::move_detail::has_move_emulation_enabled_impl<T>
|
||||
, boost_move_member_swap::has_member_swap<T> >
|
||||
>::type* = 0)
|
||||
|
|
@ -186,7 +185,7 @@ void swap_proxy(T& x, T& y
|
|||
namespace boost_move_adl_swap{
|
||||
|
||||
template<class T>
|
||||
void swap_proxy(T& x, T& y)
|
||||
BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y)
|
||||
{
|
||||
using std::swap;
|
||||
swap(x, y);
|
||||
|
|
@ -223,11 +222,45 @@ namespace boost{
|
|||
//! - Otherwise a move-based swap is called, equivalent to:
|
||||
//! <code>T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t);</code>.
|
||||
template<class T>
|
||||
void adl_move_swap(T& x, T& y)
|
||||
BOOST_MOVE_FORCEINLINE void adl_move_swap(T& x, T& y)
|
||||
{
|
||||
::boost_move_adl_swap::swap_proxy(x, y);
|
||||
}
|
||||
|
||||
//! Exchanges elements between range [first1, last1) and another range starting at first2
|
||||
//! using boost::adl_move_swap.
|
||||
//!
|
||||
//! Parameters:
|
||||
//! first1, last1 - the first range of elements to swap
|
||||
//! first2 - beginning of the second range of elements to swap
|
||||
//!
|
||||
//! Type requirements:
|
||||
//! - ForwardIt1, ForwardIt2 must meet the requirements of ForwardIterator.
|
||||
//! - The types of dereferenced ForwardIt1 and ForwardIt2 must meet the
|
||||
//! requirements of Swappable
|
||||
//!
|
||||
//! Return value: Iterator to the element past the last element exchanged in the range
|
||||
//! beginning with first2.
|
||||
template<class ForwardIt1, class ForwardIt2>
|
||||
ForwardIt2 adl_move_swap_ranges(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2)
|
||||
{
|
||||
while (first1 != last1) {
|
||||
::boost::adl_move_swap(*first1, *first2);
|
||||
++first1;
|
||||
++first2;
|
||||
}
|
||||
return first2;
|
||||
}
|
||||
|
||||
template<class BidirIt1, class BidirIt2>
|
||||
BidirIt2 adl_move_swap_ranges_backward(BidirIt1 first1, BidirIt1 last1, BidirIt2 last2)
|
||||
{
|
||||
while (first1 != last1) {
|
||||
::boost::adl_move_swap(*(--last1), *(--last2));
|
||||
}
|
||||
return last2;
|
||||
}
|
||||
|
||||
} //namespace boost{
|
||||
|
||||
#endif //#ifndef BOOST_MOVE_ADL_MOVE_SWAP_HPP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue