Created on 2011-11-01.00:00:00 last changed 67 months ago
[ This wording is relative to N4810. ]
Add to [futures.promise], class template promise synopsis, as indicated:
namespace std { template <class R> class promise { public: promise(); template <class Allocator> promise(allocator_arg_t, const Allocator& a); template <class Allocator> promise(allocator_arg_t, const Allocator& a, promise&& rhs) noexcept; promise(promise&& rhs) noexcept; promise(const promise& rhs) = delete; ~promise(); […] }; […] }
Change [futures.promise] as indicated:
promise(promise&& rhs) noexcept; template <class Allocator> promise(allocator_arg_t, const Allocator& a, promise&& rhs) noexcept;-5- Effects: constructs a new promise object and transfers ownership of the shared state of rhs (if any) to the newly-constructed object.
-6- Postcondition: rhs has no shared state. -?- [Note: a is not used — end note]
[ 2019-06-03 Jonathan Wakely provides updated wording ]
Jonathan updates wording post-2976 and observes that this resolution conflicts with 3003.
Previous resolution [SUPERSEDED]:
This wording is relative to the FDIS.
Add to [futures.promise], class template promise synopsis, as indicated:
namespace std { template <class R> class promise { public: promise(); template <class Allocator> promise(allocator_arg_t, const Allocator& a); template <class Allocator> promise(allocator_arg_t, const Allocator& a, promise&& rhs) noexcept; promise(promise&& rhs) noexcept; promise(const promise& rhs) = delete; ~promise(); […] }; […] }Change [futures.promise] as indicated:
promise(promise&& rhs) noexcept; template <class Allocator> promise(allocator_arg_t, const Allocator& a, promise&& rhs) noexcept;-5- Effects: constructs a new promise object and transfers ownership of the shared state of rhs (if any) to the newly-constructed object.
-6- Postcondition: rhs has no shared state. -?- [Note: a is not used — end note]Add to [futures.task], class template packaged_task synopsis, as indicated:
namespace std { template<class> class packaged_task; // undefined template<class R, class... ArgTypes> class packaged_task<R(ArgTypes...)> { public: // construction and destruction packaged_task() noexcept; template <class Allocator> packaged_task(allocator_arg_t, const Allocator& a) noexcept; template <class F> explicit packaged_task(F&& f); template <class F, class Allocator> explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f); ~packaged_task(); // no copy packaged_task(const packaged_task&) = delete; template<class Allocator> packaged_task(allocator_arg_t, const Allocator& a, const packaged_task&) = delete; packaged_task& operator=(const packaged_task&) = delete; // move support packaged_task(packaged_task&& rhs) noexcept; template <class Allocator> packaged_task(allocator_arg_t, const Allocator& a, packaged_task&& rhs) noexcept; packaged_task& operator=(packaged_task&& rhs) noexcept; void swap(packaged_task& other) noexcept; […] }; […] }Change [futures.task.members] as indicated:
packaged_task() noexcept; template <class Allocator> packaged_task(allocator_arg_t, const Allocator& a) noexcept;-1- Effects: constructs a packaged_task object with no shared state and no stored task.
-?- [Note: a is not used — end note][…]
packaged_task(packaged_task&& rhs) noexcept; template <class Allocator> packaged_task(allocator_arg_t, const Allocator& a, packaged_task&& rhs) noexcept;-5- Effects: constructs a new packaged_task object and transfers ownership of rhs's shared state to *this, leaving rhs with no shared state. Moves the stored task from rhs to *this.
-6- Postcondition: rhs has no shared state. -?- [Note: a is not used — end note]
[ 2016-08 Chicago ]
Fri PM: Send to LEWG - and this also applies to function in LFTS.
[ 2014-02-20 Re-open Deferred issues as Priority 4 ]
[ 2013-09 Chicago ]
Move to deferred.
This issue has much in common with similar problems with std::function that are being addressed by the polymorphic allocators proposal currently under evaluation in LEWG. Defer further discussion on this topic until the final outcome of that paper and its proposed resolution is known.
[ 2013-03-06 ]
Jonathan suggests to make the new constructors non-explicit and makes some representational improvements.
[ 2012, Portland ]
This is an allocator issue, and should be dealt with directly by LWG.
This example is ill-formed according to C++11 because uses_allocator<promise<R>, A>::value is true, but is_constructible<promise<R>, A, promise<R>&&>::value is false. Similarly for packaged_task.
#include <future> #include <memory> #include <tuple> using namespace std; typedef packaged_task<void()> task; typedef promise<void> prom; allocator<task> a; tuple<task, prom> t1{ allocator_arg, a }; tuple<task, prom> t2{ allocator_arg, a, task{}, prom{} };
History | |||
---|---|---|---|
Date | User | Action | Args |
2019-06-03 09:53:27 | admin | set | messages: + msg10412 |
2016-08-06 21:12:20 | admin | set | messages: + msg8442 |
2016-08-06 21:12:20 | admin | set | status: open -> lewg |
2014-02-20 14:24:46 | admin | set | messages: + msg6881 |
2014-02-20 14:24:46 | admin | set | status: deferred -> open |
2013-09-26 11:12:18 | admin | set | messages: + msg6624 |
2013-09-26 11:12:18 | admin | set | status: new -> deferred |
2013-03-17 21:47:11 | admin | set | messages: + msg6397 |
2012-11-02 22:48:46 | admin | set | messages: + msg6236 |
2011-11-27 19:46:43 | admin | set | messages: + msg5920 |
2011-11-01 00:00:00 | admin | create |