summaryrefslogtreecommitdiff
path: root/boost/fiber/future/detail/task_object.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fiber/future/detail/task_object.hpp')
-rw-r--r--boost/fiber/future/detail/task_object.hpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/boost/fiber/future/detail/task_object.hpp b/boost/fiber/future/detail/task_object.hpp
index 8cd4dbc96a..e879f8169e 100644
--- a/boost/fiber/future/detail/task_object.hpp
+++ b/boost/fiber/future/detail/task_object.hpp
@@ -33,9 +33,10 @@ template< typename Fn, typename Allocator, typename R, typename ... Args >
class task_object : public task_base< R, Args ... > {
private:
typedef task_base< R, Args ... > base_type;
+ typedef std::allocator_traits< Allocator > allocator_traits;
public:
- typedef typename std::allocator_traits< Allocator >::template rebind_alloc<
+ typedef typename allocator_traits::template rebind_alloc<
task_object
> allocator_type;
@@ -93,8 +94,9 @@ private:
static void destroy_( allocator_type const& alloc, task_object * p) noexcept {
allocator_type a{ alloc };
- a.destroy( p);
- a.deallocate( p, 1);
+ typedef std::allocator_traits< allocator_type > traity_type;
+ traity_type::destroy( a, p);
+ traity_type::deallocate( a, p, 1);
}
};
@@ -102,11 +104,12 @@ template< typename Fn, typename Allocator, typename ... Args >
class task_object< Fn, Allocator, void, Args ... > : public task_base< void, Args ... > {
private:
typedef task_base< void, Args ... > base_type;
+ typedef std::allocator_traits< Allocator > allocator_traits;
public:
- typedef typename Allocator::template rebind<
+ typedef typename allocator_traits::template rebind_alloc<
task_object< Fn, Allocator, void, Args ... >
- >::other allocator_type;
+ > allocator_type;
task_object( allocator_type const& alloc, Fn const& fn) :
base_type{},
@@ -161,8 +164,9 @@ private:
static void destroy_( allocator_type const& alloc, task_object * p) noexcept {
allocator_type a{ alloc };
- a.destroy( p);
- a.deallocate( p, 1);
+ typedef std::allocator_traits< allocator_type > traity_type;
+ traity_type::destroy( a, p);
+ traity_type::deallocate( a, p, 1);
}
};