Skip to content

Commit d42db7e

Browse files
committed
Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.
llvm-svn: 319080
1 parent 0b49f9e commit d42db7e

File tree

5 files changed

+2
-73
lines changed

5 files changed

+2
-73
lines changed

libcxx/include/future

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,6 @@ public:
328328
packaged_task() noexcept;
329329
template <class F>
330330
explicit packaged_task(F&& f);
331-
template <class F, class Allocator>
332-
packaged_task(allocator_arg_t, const Allocator& a, F&& f);
333331
~packaged_task();
334332
335333
// no copy
@@ -356,8 +354,6 @@ public:
356354
template <class R>
357355
void swap(packaged_task<R(ArgTypes...)&, packaged_task<R(ArgTypes...)>&) noexcept;
358356
359-
template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
360-
361357
} // std
362358
363359
*/
@@ -2028,19 +2024,6 @@ public:
20282024
>
20292025
_LIBCPP_INLINE_VISIBILITY
20302026
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
2031-
template <class _Fp, class _Allocator,
2032-
class = typename enable_if
2033-
<
2034-
!is_same<
2035-
typename decay<_Fp>::type,
2036-
packaged_task
2037-
>::value
2038-
>::type
2039-
>
2040-
_LIBCPP_INLINE_VISIBILITY
2041-
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
2042-
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
2043-
__p_(allocator_arg, __a) {}
20442027
// ~packaged_task() = default;
20452028

20462029
// no copy
@@ -2157,19 +2140,6 @@ public:
21572140
>
21582141
_LIBCPP_INLINE_VISIBILITY
21592142
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
2160-
template <class _Fp, class _Allocator,
2161-
class = typename enable_if
2162-
<
2163-
!is_same<
2164-
typename decay<_Fp>::type,
2165-
packaged_task
2166-
>::value
2167-
>::type
2168-
>
2169-
_LIBCPP_INLINE_VISIBILITY
2170-
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
2171-
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
2172-
__p_(allocator_arg, __a) {}
21732143
// ~packaged_task() = default;
21742144

21752145
// no copy
@@ -2271,10 +2241,6 @@ swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
22712241
__x.swap(__y);
22722242
}
22732243

2274-
template <class _Callable, class _Alloc>
2275-
struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
2276-
: public true_type {};
2277-
22782244
template <class _Rp, class _Fp>
22792245
future<_Rp>
22802246
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor2.fail.cpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

libcxx/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
// class packaged_task<R(ArgTypes...)>
1818

19-
// template <class F, class Allocator>
20-
// explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f);
21-
2219
#include <future>
2320
#include <cassert>
2421

libcxx/www/cxx1z_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ <h3>Library Working group Issues Status</h3>
487487
<tr><td><a href="https://wg21.link/LWG2905">2905</a></td><td>is_constructible_v&lt;unique_ptr&lt;P, D&gt;, P, D const &amp;&gt; should be false when D is not copy constructible</td><td>Kona</td><td>Complete</td></tr>
488488
<tr><td><a href="https://wg21.link/LWG2908">2908</a></td><td>The less-than operator for shared pointers could do more</td><td>Kona</td><td></td></tr>
489489
<tr><td><a href="https://wg21.link/LWG2911">2911</a></td><td>An is_aggregate type trait is needed</td><td>Kona</td><td>Complete</td></tr>
490-
<tr><td><a href="https://wg21.link/LWG2921">2921</a></td><td>packaged_task and type-erased allocators</td><td>Kona</td><td></td></tr>
490+
<tr><td><a href="https://wg21.link/LWG2921">2921</a></td><td>packaged_task and type-erased allocators</td><td>Kona</td><td>Complete</td></tr>
491491
<tr><td><a href="https://wg21.link/LWG2934">2934</a></td><td>optional&lt;const T&gt; doesn't compare with T</td><td>Kona</td><td>Complete</td></tr>
492492
<tr><td></td><td></td><td></td><td></td></tr>
493493
<tr><td><a href="https://wg21.link/LWG2901">2901</a></td><td>Variants cannot properly support allocators</td><td>Toronto</td><td>Complete</td></tr>

libcxx/www/cxx2a_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ <h3>Library Working group Issues Status</h3>
114114
<tr><td><a href="https://wg21.link/LWG2964">2964</a></td><td>Apparently redundant requirement for dynamic_pointer_cast</td><td>Albuquerque</td><td></td></tr>
115115
<tr><td><a href="https://wg21.link/LWG2965">2965</a></td><td>Non-existing path::native_string() in filesystem_error::what() specification</td><td>Albuquerque</td><td></td></tr>
116116
<tr><td><a href="https://wg21.link/LWG2972">2972</a></td><td>What is is_trivially_destructible_v<int>?</td><td>Albuquerque</td><td>Complete</td></tr>
117-
<tr><td><a href="https://wg21.link/LWG2976">2976</a></td><td>Dangling uses_allocator specialization for packaged_task</td><td>Albuquerque</td><td></td></tr>
117+
<tr><td><a href="https://wg21.link/LWG2976">2976</a></td><td>Dangling uses_allocator specialization for packaged_task</td><td>Albuquerque</td><td>Complete</td></tr>
118118
<tr><td><a href="https://wg21.link/LWG2977">2977</a></td><td>unordered_meow::merge() has incorrect Throws: clause</td><td>Albuquerque</td><td></td></tr>
119119
<tr><td><a href="https://wg21.link/LWG2978">2978</a></td><td>Hash support for pmr::string and friends</td><td>Albuquerque</td><td></td></tr>
120120
<tr><td><a href="https://wg21.link/LWG2979">2979</a></td><td>aligned_union should require complete object types</td><td>Albuquerque</td><td>Complete</td></tr>

0 commit comments

Comments
 (0)