Title
packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit
Status
c++17
Section
[futures.task.members]
Submitter
Stephan T. Lavavej

Created on 2014-06-14.00:00:00 last changed 90 months ago

Messages

Date: 2015-05-08.04:24:55

Proposed resolution:

This wording is relative to N3936.

  1. Change [futures.task] p2, class template packaged_task as indicated:

    template <class F>
    explicit packaged_task(F&& f);
    template <class F, class Allocator>
    explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f);
    
  2. Change [futures.task.members] as indicated:

    template <class F>
    packaged_task(F&& f);
    template <class F, class Allocator>
    explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f);
    

    […]

    -3- Remarks: These constructors shall not participate in overload resolution if decay_t<F> is the same type as std::packaged_task<R(ArgTypes...)>.

Date: 2015-05-08.04:24:55

[ 2015-05 Lenexa ]

STL improves proposed wording by restoring the constraint again.

Date: 2015-05-08.04:24:55

[ 2015-05 Lenexa, SG1 response ]

Back to LWG; not an SG1 issue.

Date: 2015-04-04.16:45:17

[ 2015-02 Cologne ]

Handed over to SG1.

Date: 2014-06-14.00:00:00

LWG 2097's resolution was slightly too aggressive. It constrained packaged_task(allocator_arg_t, const Allocator&, F&&), but that's unnecessary because packaged_task doesn't have any other three-argument constructors. Additionally, it's marked as explicit (going back to WP N2798 when packaged_task first appeared) which is unnecessary.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-05-22 18:31:21adminsetstatus: immediate -> wp
2015-05-08 04:24:55adminsetmessages: + msg7403
2015-05-07 19:30:46adminsetstatus: open -> immediate
2015-05-06 17:46:12adminsetmessages: + msg7362
2015-04-04 16:45:17adminsetmessages: + msg7336
2015-04-04 16:45:17adminsetstatus: new -> open
2014-06-14 21:37:14adminsetmessages: + msg7045
2014-06-14 00:00:00admincreate