updated boost on windows
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/fiber/detail/convert.hpp>
|
||||
#include <boost/fiber/detail/disable_overload.hpp>
|
||||
#include <boost/fiber/exceptions.hpp>
|
||||
#include <boost/fiber/future/detail/task_base.hpp>
|
||||
@@ -57,20 +56,22 @@ public:
|
||||
typedef std::allocator_traits<
|
||||
typename object_type::allocator_type
|
||||
> traits_type;
|
||||
typedef pointer_traits< typename traits_type::pointer > ptrait_type;
|
||||
|
||||
typename object_type::allocator_type a{ alloc };
|
||||
typename traits_type::pointer ptr{ traits_type::allocate( a, 1) };
|
||||
typename ptrait_type::element_type* p = boost::to_address(ptr);
|
||||
try {
|
||||
traits_type::construct( a, ptr, a, std::forward< Fn >( fn) );
|
||||
traits_type::construct( a, p, a, std::forward< Fn >( fn) );
|
||||
} catch (...) {
|
||||
traits_type::deallocate( a, ptr, 1);
|
||||
throw;
|
||||
}
|
||||
task_.reset( convert( ptr) );
|
||||
task_.reset(p);
|
||||
}
|
||||
|
||||
~packaged_task() {
|
||||
if ( task_) {
|
||||
if ( task_ && obtained_) {
|
||||
task_->owner_destroyed();
|
||||
}
|
||||
}
|
||||
@@ -85,7 +86,7 @@ public:
|
||||
}
|
||||
|
||||
packaged_task & operator=( packaged_task && other) noexcept {
|
||||
if ( this != & other) {
|
||||
if ( BOOST_LIKELY( this != & other) ) {
|
||||
packaged_task tmp{ std::move( other) };
|
||||
swap( tmp);
|
||||
}
|
||||
@@ -105,7 +106,7 @@ public:
|
||||
if ( obtained_) {
|
||||
throw future_already_retrieved{};
|
||||
}
|
||||
if ( ! valid() ) {
|
||||
if ( BOOST_UNLIKELY( ! valid() ) ) {
|
||||
throw packaged_task_uninitialized{};
|
||||
}
|
||||
obtained_ = true;
|
||||
@@ -114,14 +115,14 @@ public:
|
||||
}
|
||||
|
||||
void operator()( Args ... args) {
|
||||
if ( ! valid() ) {
|
||||
if ( BOOST_UNLIKELY( ! valid() ) ) {
|
||||
throw packaged_task_uninitialized{};
|
||||
}
|
||||
task_->run( std::forward< Args >( args) ... );
|
||||
}
|
||||
|
||||
void reset() {
|
||||
if ( ! valid() ) {
|
||||
if ( BOOST_UNLIKELY( ! valid() ) ) {
|
||||
throw packaged_task_uninitialized{};
|
||||
}
|
||||
packaged_task tmp;
|
||||
|
||||
Reference in New Issue
Block a user