update boost
This commit is contained in:
@@ -21,9 +21,19 @@
|
||||
namespace boost {
|
||||
namespace fibers {
|
||||
|
||||
#if (defined(BOOST_MSVC) && (_MSC_VER >= 1911 && _MSVC_LANG >= 201703)) || __cplusplus >= 202002L
|
||||
template <typename>
|
||||
struct result_of;
|
||||
template <typename F, typename... Args>
|
||||
struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
|
||||
#else
|
||||
using std::result_of;
|
||||
#endif
|
||||
|
||||
|
||||
template< typename Fn, typename ... Args >
|
||||
future<
|
||||
typename std::result_of<
|
||||
typename result_of<
|
||||
typename std::enable_if<
|
||||
! detail::is_launch_policy< typename std::decay< Fn >::type >::value,
|
||||
typename std::decay< Fn >::type
|
||||
@@ -31,7 +41,7 @@ future<
|
||||
>::type
|
||||
>
|
||||
async( Fn && fn, Args ... args) {
|
||||
typedef typename std::result_of<
|
||||
typedef typename result_of<
|
||||
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
|
||||
>::type result_type;
|
||||
|
||||
@@ -44,7 +54,7 @@ async( Fn && fn, Args ... args) {
|
||||
|
||||
template< typename Policy, typename Fn, typename ... Args >
|
||||
future<
|
||||
typename std::result_of<
|
||||
typename result_of<
|
||||
typename std::enable_if<
|
||||
detail::is_launch_policy< Policy >::value,
|
||||
typename std::decay< Fn >::type
|
||||
@@ -52,7 +62,7 @@ future<
|
||||
>::type
|
||||
>
|
||||
async( Policy policy, Fn && fn, Args ... args) {
|
||||
typedef typename std::result_of<
|
||||
typedef typename result_of<
|
||||
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
|
||||
>::type result_type;
|
||||
|
||||
@@ -65,7 +75,7 @@ async( Policy policy, Fn && fn, Args ... args) {
|
||||
|
||||
template< typename Policy, typename StackAllocator, typename Fn, typename ... Args >
|
||||
future<
|
||||
typename std::result_of<
|
||||
typename result_of<
|
||||
typename std::enable_if<
|
||||
detail::is_launch_policy< Policy >::value,
|
||||
typename std::decay< Fn >::type
|
||||
@@ -73,7 +83,7 @@ future<
|
||||
>::type
|
||||
>
|
||||
async( Policy policy, std::allocator_arg_t, StackAllocator salloc, Fn && fn, Args ... args) {
|
||||
typedef typename std::result_of<
|
||||
typedef typename result_of<
|
||||
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
|
||||
>::type result_type;
|
||||
|
||||
@@ -87,7 +97,7 @@ async( Policy policy, std::allocator_arg_t, StackAllocator salloc, Fn && fn, Arg
|
||||
|
||||
template< typename Policy, typename StackAllocator, typename Allocator, typename Fn, typename ... Args >
|
||||
future<
|
||||
typename std::result_of<
|
||||
typename result_of<
|
||||
typename std::enable_if<
|
||||
detail::is_launch_policy< Policy >::value,
|
||||
typename std::decay< Fn >::type
|
||||
@@ -95,7 +105,7 @@ future<
|
||||
>::type
|
||||
>
|
||||
async( Policy policy, std::allocator_arg_t, StackAllocator salloc, Allocator alloc, Fn && fn, Args ... args) {
|
||||
typedef typename std::result_of<
|
||||
typedef typename result_of<
|
||||
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
|
||||
>::type result_type;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <exception>
|
||||
#include <utility>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -30,8 +31,8 @@ struct future_base {
|
||||
|
||||
future_base() = default;
|
||||
|
||||
explicit future_base( ptr_type const& p) noexcept :
|
||||
state_{ p } {
|
||||
explicit future_base( ptr_type p) noexcept :
|
||||
state_{std::move( p )} {
|
||||
}
|
||||
|
||||
~future_base() = default;
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
promise( promise const&) = delete;
|
||||
promise & operator=( promise const&) = delete;
|
||||
|
||||
promise( promise && other) noexcept = default;
|
||||
promise( promise && other) = default;
|
||||
promise & operator=( promise && other) = default;
|
||||
|
||||
void set_value( R const& value) {
|
||||
@@ -158,8 +158,8 @@ public:
|
||||
promise( promise const&) = delete;
|
||||
promise & operator=( promise const&) = delete;
|
||||
|
||||
promise( promise && other) noexcept = default;
|
||||
promise & operator=( promise && other) noexcept = default;
|
||||
promise( promise && other) = default;
|
||||
promise & operator=( promise && other) = default;
|
||||
|
||||
void set_value( R & value) {
|
||||
if ( BOOST_UNLIKELY( ! base_type::future_) ) {
|
||||
@@ -192,8 +192,8 @@ public:
|
||||
promise( promise const&) = delete;
|
||||
promise & operator=( promise const&) = delete;
|
||||
|
||||
promise( promise && other) noexcept = default;
|
||||
promise & operator=( promise && other) noexcept = default;
|
||||
promise( promise && other) = default;
|
||||
promise & operator=( promise && other) = default;
|
||||
|
||||
inline
|
||||
void set_value() {
|
||||
|
||||
Reference in New Issue
Block a user