summaryrefslogtreecommitdiffstats
path: root/libcxx/include/future
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2013-10-12 22:49:17 +0000
committerMarshall Clow <mclow.lists@gmail.com>2013-10-12 22:49:17 +0000
commitd58daf94337f5e06d867c64869f2763e73f01df2 (patch)
tree5ae244e6bb9f33f821fc4e031e878f72fedbe6bd /libcxx/include/future
parentb212f3baa1c17e7739d4cebba3b3697292cf796e (diff)
downloadbcm5719-llvm-d58daf94337f5e06d867c64869f2763e73f01df2.tar.gz
bcm5719-llvm-d58daf94337f5e06d867c64869f2763e73f01df2.zip
LWG Issue 2097: packaged_task constructors should be constrained
llvm-svn: 192544
Diffstat (limited to 'libcxx/include/future')
-rw-r--r--libcxx/include/future40
1 files changed, 36 insertions, 4 deletions
diff --git a/libcxx/include/future b/libcxx/include/future
index 334eaeb5e1f..2d969df1b53 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -2013,10 +2013,26 @@ public:
// construction and destruction
_LIBCPP_INLINE_VISIBILITY
packaged_task() _NOEXCEPT : __p_(nullptr) {}
- template <class _Fp>
+ template <class _Fp,
+ class = typename enable_if
+ <
+ !is_same<
+ typename decay<_Fp>::type,
+ packaged_task
+ >::value
+ >::type
+ >
_LIBCPP_INLINE_VISIBILITY
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
- template <class _Fp, class _Allocator>
+ template <class _Fp, class _Allocator,
+ class = typename enable_if
+ <
+ !is_same<
+ typename decay<_Fp>::type,
+ packaged_task
+ >::value
+ >::type
+ >
_LIBCPP_INLINE_VISIBILITY
explicit packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
@@ -2128,10 +2144,26 @@ public:
// construction and destruction
_LIBCPP_INLINE_VISIBILITY
packaged_task() _NOEXCEPT : __p_(nullptr) {}
- template <class _Fp>
+ template <class _Fp,
+ class = typename enable_if
+ <
+ !is_same<
+ typename decay<_Fp>::type,
+ packaged_task
+ >::value
+ >::type
+ >
_LIBCPP_INLINE_VISIBILITY
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
- template <class _Fp, class _Allocator>
+ template <class _Fp, class _Allocator,
+ class = typename enable_if
+ <
+ !is_same<
+ typename decay<_Fp>::type,
+ packaged_task
+ >::value
+ >::type
+ >
_LIBCPP_INLINE_VISIBILITY
explicit packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
OpenPOWER on IntegriCloud