Title
The function template std::apply() is required to be constexpr, but std::invoke() isn't
Status
resolved
Section
[func.invoke]
Submitter
Great Britain

Created on 2017-02-03.00:00:00 last changed 51 months ago

Messages

Date: 2020-01-13.07:01:29

Proposed resolution:

This wording is relative to N4640.

  1. Modify [func.invoke] as indicated:

    template <class F, class... Args>
         constexpr result_of_t<F&&(Args&&...)> invoke(F&& f, Args&&... args);
    
Date: 2020-01-13.07:01:29

[ 2020-01 Resolved by the adoption of P1065 in Cologne. ]

Date: 2017-07-12.01:58:24

[ 2017-07 Toronto Tuesday PM issue prioritization ]

Priority 3

Date: 2017-03-05.23:48:53

[ Kona 2017-03-01 ]

We think this needs CWG 1581 to work; accepted as Immediate to resolve NB comment.

Friday: CWG 1581 was not moved in Kona. Status back to Open.

Date: 2017-02-15.00:00:00

[ 2017-02-20, Marshall adds wording ]

Date: 2017-02-03.00:00:00
Addresses GB 51

The function template std::apply() in [tuple.apply] is required to be constexpr, but std::invoke() in [func.invoke] isn't. The most sensible implementation of apply_impl() is exactly equivalent to std::invoke(), so this requires implementations to have a constexpr version of invoke() for internal use, and the public API std::invoke, which must not be constexpr even though it is probably implemented in terms of the internal version.

Proposed change: Add constexpr to std::invoke.

History
Date User Action Args
2020-01-13 07:01:29adminsetmessages: + msg10923
2020-01-13 07:01:29adminsetstatus: open -> resolved
2017-07-12 01:58:24adminsetmessages: + msg9352
2017-03-05 23:48:53adminsetstatus: wp -> open
2017-03-05 23:46:08adminsetstatus: immediate -> wp
2017-03-03 22:14:37adminsetmessages: + msg9069
2017-03-03 22:14:37adminsetstatus: new -> immediate
2017-02-20 18:11:16adminsetmessages: + msg8954
2017-02-20 18:11:16adminsetmessages: + msg8953
2017-02-03 00:00:00admincreate