Title
Is shared_future intended to work with arrays or function types?
Status
resolved
Section
[futures.unique.future][futures.shared.future]
Submitter
Tomasz Kamiński

Created on 2020-06-28.00:00:00 last changed 49 months ago

Messages

Date: 2020-11-09.22:09:52

Proposed resolution:

Resolved by 3466

Date: 2020-11-09.00:00:00

[ 2020-11-09 Resolved by acceptance of 3466. Status changed: Tentatively Resolved → Resolved. ]

Date: 2020-08-15.00:00:00

[ 2020-08-02; Daniel comments ]

I'm request to reopen the issue and to follow the recent wording update of LWG 3466 instead.

Date: 2020-07-15.00:00:00

[ 2020-07-17; Reflector prioritization ]

Set priority to 0 and status to Tentatively Ready after six votes in favour during reflector discussions.

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.

  1. Modify [futures.unique.future] as indicated:

    namespace std {
      template<class R>
      class future {
        […]
      };
    }
    

    -?- If is_array_v<R> is true or is_function_v<R> is true, the program is ill-formed.

    -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.

  2. Modify [futures.shared.future] as indicated:

    namespace std {
      template<class R>
      class shared_future {
        […]
      };
    }
    

    -?- If is_array_v<R> is true or is_function_v<R> is true, the program is ill-formed.

    -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.

Date: 2020-06-28.00:00:00

Currently there is no prohibition of creating shared_future<T> where T is either an array type or a function type. However such objects cannot be constructed, as the corresponding future<T>, is ill-formed due the signature get() method being ill-formed — it will be declared as function returning an array or function type, respectively. [Note: For shared_future get always returns an reference, so it is well-formed for array or function types.]

History
Date User Action Args
2020-11-09 22:09:52adminsetmessages: + msg11593
2020-08-21 20:18:09adminsetstatus: open -> resolved
2020-08-02 16:31:12adminsetmessages: + msg11423
2020-08-02 16:31:12adminsetstatus: ready -> open
2020-07-17 22:37:26adminsetmessages: + msg11376
2020-07-17 22:37:26adminsetstatus: new -> ready
2020-06-28 12:53:26adminsetmessages: + msg11353
2020-06-28 00:00:00admincreate