Title
ranges::drop_while_view::begin() is missing a precondition
Status
c++23
Section
[range.drop.while.view]
Submitter
Michael Schellenberger Costa

Created on 2020-10-13.00:00:00 last changed 12 months ago

Messages

Date: 2021-02-26.17:31:29

Proposed resolution:

This wording is relative to N4868.

  1. Modify [range.drop.while.view] as indicated:

    Since we usually don't rely on implicit bool conversion in Preconditions: elements an explicit "is true" has been added. Editorial fixes of the referenced paragraph [range.drop.while.view] p3 and similar places have been requested separately.

    constexpr auto begin();
    

    -?- Preconditions: pred_.has_value() is true.

    -3- Returns: ranges::find_if_not(base_, cref(*pred_)).

    -4- […]

Date: 2021-02-26.00:00:00

[ 2021-02-26 Approved at February 2021 virtual plenary. Status changed: Tentatively Ready → WP. ]

Date: 2020-11-15.00:00:00

[ 2020-11-07; Reflector prioritization ]

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

Date: 2020-10-13.00:00:00

Similar to ranges::filter_view [range.filter.view] p3, ranges::drop_while_view should have a precondition on its begin() method that the predicate is set.

I propose to add as [range.drop.while.view] p3:

Preconditions: pred_.has_value().  
History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-02-26 17:31:29adminsetmessages: + msg11701
2021-02-26 17:31:29adminsetstatus: ready -> wp
2020-11-07 19:23:15adminsetmessages: + msg11529
2020-11-07 19:23:15adminsetstatus: new -> ready
2020-10-26 17:18:52adminsetmessages: + msg11518
2020-10-13 00:00:00admincreate