Created on 2020-07-18.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4861.
Modify [futures.promise] as indicated:
namespace std { template<class R> class promise { […] }; […] }-?- For the primary template, R shall be an object type that meets the Cpp17Destructible requirements.
-1- The implementation provides the template promise and two specializations, promise<R&> and promise<void>. These differ only in the argument type of the member functions set_value and set_value_at_thread_exit, as set out in their descriptions, below.
Modify [futures.unique.future] as indicated:
namespace std { template<class R> class future { […] }; }-?- For the primary template, R shall be an object type that meets the Cpp17Destructible requirements.
-4- The implementation provides the template future and two specializations, future<R&> and future<void>. These differ only in the return type and return value of the member function get, as set out in its description, below.
Modify [futures.shared.future] as indicated:
namespace std { template<class R> class shared_future { […] }; }-?- For the primary template, R shall be an object type that meets the Cpp17Destructible requirements.
-4- The implementation provides the template shared_future and two specializations, shared_future<R&> and shared_future<void>. These differ only in the return type and return value of the member function get, as set out in its description, below.
[ 2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready → WP. ]
[ 2020-08-21; Issue processing telecon: Tentatively Ready ]
Discussed a note clarifying that Cpp17Destructible disallows arrays (as well as types without accessible destructors). Can be added editorially.
[ 2020-08-02; Daniel comments and provides alternative wording ]
Following the suggestion of Tim Song a revised wording is provided which is intended to replace the currently agreed on wording for LWG 3458.
[ 2020-07-26; Reflector prioritization ]
Set priority to 3 after reflector discussions. Tim Song made the suggestion to replace the P/R wording by the following alternative wording:
For the primary template, R shall be an object type that meets the Cpp17Destructible requirements.
Previous resolution [SUPERSEDED]:
This wording is relative to N4861.
Ideally the wording below would use a Mandates: element, but due to the still open issue LWG 3193 the wording below uses instead the more general "ill-formed" vocabulary.
Modify [futures.promise] as indicated:
namespace std { template<class R> class promise { […] }; […] }-?- If is_array_v<R> is true or is_function_v<R> is true, the program is ill-formed.
The resolution of the LWG 3458 clearly specified the requirement that future/shared_future are ill-formed in situations when T is native array or function type. This requirement was not strictly necessary for future<T> as it was already ill-formed due the signature of the get function (that would be ill-formed in such case), however it was still added for consistency of specification. Similar, requirement should be introduced for the promise<T>, for which any call to get_future() would be ill-formed, if T is of array or function type.
[Note: promise<int[10]> is ill-formed for libstdc++ and libc++, see this code]History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2020-11-09 21:40:50 | admin | set | messages: + msg11584 |
2020-11-09 21:40:50 | admin | set | status: ready -> wp |
2020-08-21 20:18:09 | admin | set | messages: + msg11447 |
2020-08-21 20:18:09 | admin | set | status: new -> ready |
2020-08-02 16:30:32 | admin | set | messages: + msg11422 |
2020-07-26 12:40:13 | admin | set | messages: + msg11411 |
2020-07-19 16:56:49 | admin | set | messages: + msg11406 |
2020-07-18 00:00:00 | admin | create |