Title
Inconsistencies in bind_front wording
Status
c++20
Section
[func.bind.partial]
Submitter
Tomasz Kamiński

Created on 2019-01-16.00:00:00 last changed 45 months ago

Messages

Date: 2019-01-26.14:09:17

Proposed resolution:

This wording is relative to N4791.

  1. Change [func.not_fn] as indicated:

    template<class F> unspecified not_fn(F&& f);
    

    -1- In the text that follows:

    1. (1.1) — […]

    2. (1.2) — […]

    3. (1.3) — fd is the target object of g ([func.def]) of type FD direct-non-list-initialized withinitialized with the initializer (std::forward<F>(f)) ([dcl.init]),

    4. (1.4) — […]

  2. Change [func.bind_front] as indicated:

    template <class F, class... Args>
    unspecified bind_front(F&& f, Args&&... args);
    

    -1- In the text that follows:

    1. (1.1) — […]

    2. (1.2) — […]

    3. (1.3) — fd is the target object of g ([func.def]) of type FD direct-non-list-initialized withinitialized with the initializer (std::forward<F>(f)) ([dcl.init]),

    4. (1.4) — […]

    5. (1.5) — bound_args is a pack of bound argument entities of g ([func.def]) of types BoundArgs..., direct-non-list-initialized withinitialized with initializers (std::forward<Args>(args))..., respectively, and

    6. (1.6) — […]

    -2- Mandates:

    is_constructible_v<FD, F> && is_move_constructible_v<FD> && 
    (is_constructible_v<BoundArgs, Args> && ...) && (is_move_constructible_v<BoundArgs> && ...)conjunction_v<is_constructible<FD, F>, is_move_constructible<FD>,
    is_constructible<BoundArgs, Args>..., is_move_constructible<BoundArgs>...>
    

    shall be true.

Date: 2019-01-26.00:00:00

[ 2019-01-26 Priority to 0 and Status to Tentatively Ready after five positive votes on the reflector. ]

Date: 2019-01-16.00:00:00

During the merge of the P0356R5, following "oddities" of the new wording was pointed out by Jens Maurer:

  1. The initialization of the state entities of the bind_front/not_fn is specified using formulation "xx initialized with the initializer (yyy)". Per author knowledge this specification is correct, however inconsistent with the other parts of the of the standard, that direct-non-list-initialization term in such context.

  2. The specification of the Mandates element for bind_front uses conjunction_v to specify conjunction of the requirements, while corresponding element of the not_fn specifies it using &&. As conjuction_v implies order of evaluation that is not necessary in this case (for every valid program, all provided traits must evaluate to true), it may be replaced with usage of fold expression with operator &&.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2019-07-22 15:46:37adminsetstatus: voting -> wp
2019-06-17 05:25:36adminsetstatus: ready -> voting
2019-01-26 14:09:17adminsetmessages: + msg10296
2019-01-26 14:09:17adminsetstatus: new -> ready
2019-01-20 14:27:13adminsetmessages: + msg10281
2019-01-16 00:00:00admincreate