Commit 135a0d0a by Paolo Carlini Committed by Paolo Carlini

future (uses_allocator<packaged_task<>,>): Add; minor formatting tweaks.

2010-10-08  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/future (uses_allocator<packaged_task<>,>): Add;
	minor formatting tweaks.

From-SVN: r165151
parent 5f262d13
2010-10-08 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/future (uses_allocator<packaged_task<>,>): Add;
minor formatting tweaks.
2010-10-08 Jonathan Wakely <jwakely.gcc@gmail.com> 2010-10-08 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/std/future: Enable allocator support. * include/std/future: Enable allocator support.
......
...@@ -904,6 +904,11 @@ namespace std ...@@ -904,6 +904,11 @@ namespace std
swap(promise<_Res>& __x, promise<_Res>& __y) swap(promise<_Res>& __x, promise<_Res>& __y)
{ __x.swap(__y); } { __x.swap(__y); }
template<typename _Res, typename _Alloc>
struct uses_allocator<promise<_Res>, _Alloc>
: public true_type { };
/// Partial specialization for promise<R&> /// Partial specialization for promise<R&>
template<typename _Res> template<typename _Res>
class promise<_Res&> class promise<_Res&>
...@@ -1002,7 +1007,6 @@ namespace std ...@@ -1002,7 +1007,6 @@ namespace std
_M_storage(std::move(__rhs._M_storage)) _M_storage(std::move(__rhs._M_storage))
{ } { }
template<typename _Allocator> template<typename _Allocator>
promise(allocator_arg_t, const _Allocator& __a) promise(allocator_arg_t, const _Allocator& __a)
: _M_future(std::allocate_shared<_State>(__a)), : _M_future(std::allocate_shared<_State>(__a)),
...@@ -1076,9 +1080,6 @@ namespace std ...@@ -1076,9 +1080,6 @@ namespace std
_M_future->_M_set_result(std::move(__setter)); _M_future->_M_set_result(std::move(__setter));
} }
template<typename _Res, class Alloc>
struct uses_allocator<promise<_Res>, Alloc> : true_type { };
template<typename _StateT, typename _Res> template<typename _StateT, typename _Res>
struct __future_base::_Task_setter struct __future_base::_Task_setter
...@@ -1129,8 +1130,8 @@ namespace std ...@@ -1129,8 +1130,8 @@ namespace std
template<typename _Func, typename _Alloc> template<typename _Func, typename _Alloc>
_Task_state(_Func&& __task, const _Alloc& __a) _Task_state(_Func&& __task, const _Alloc& __a)
: _M_result(_S_allocate_result<_Res>(__a)) : _M_result(_S_allocate_result<_Res>(__a)),
, _M_task(allocator_arg, __a, std::move(__task)) _M_task(allocator_arg, __a, std::move(__task))
{ } { }
void void
...@@ -1249,6 +1250,11 @@ namespace std ...@@ -1249,6 +1250,11 @@ namespace std
packaged_task<_Res(_ArgTypes...)>& __y) packaged_task<_Res(_ArgTypes...)>& __y)
{ __x.swap(__y); } { __x.swap(__y); }
template<typename _Res, typename _Alloc>
struct uses_allocator<packaged_task<_Res>, _Alloc>
: public true_type { };
template<typename _Res> template<typename _Res>
class __future_base::_Deferred_state : public __future_base::_State class __future_base::_Deferred_state : public __future_base::_State
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment