Title
Finish removing subrange's conversions from pair-like
Status
c++23
Section
[range.subrange]
Submitter
Casey Carter

Created on 2019-02-20.00:00:00 last changed 12 months ago

Messages

Date: 2020-11-09.21:40:50

Proposed resolution:

This wording is relative to N4849.

  1. Modify [range.subrange] as indicated:

    […]
    template<class T, class U, class V>
      concept pair-like-convertible-from = // exposition only
        !range<T> && pair-like<T> && constructible_from<T, U, V>;
    
    template<class T>
      concept iterator-sentinel-pair = // exposition only
        !range<T> && pair-like<T> &&
        sentinel_for<tuple_element_t<1, T>, tuple_element_t<0, T>>;
        
    […]
    
    template<iterator-sentinel-pair P>
      subrange(P) -> subrange<tuple_element_t<0, P>, tuple_element_t<1, P>>;
    
    template<iterator-sentinel-pair P>
      subrange(P, make-unsigned-like-t(iter_difference_t<tuple_element_t<0, P>>)) ->
        subrange<uple_element_t<0, P>, tuple_element_t<1, P>, subrange_kind::sized>;
    […]
    
Date: 2020-11-09.00:00:00

[ 2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready → WP. ]

Date: 2020-03-11.00:00:00

[ 2020-03-11 Issue Prioritization ]

Status set to Tentatively Ready after seven positive votes on the reflector.

Date: 2019-02-20.00:00:00

Both LWG 3281 "Conversion from pair-like types to subrange is a silent semantic promotion" and LWG 3282 "subrange converting constructor should disallow derived to base conversions" removed subrange's hated implicit conversions from pair-like types. Notably, neither issue removed the two "iterator-sentinel-pair" deduction guides which target the removed constructors nor the exposition-only iterator-sentinel-pair concept itself, all of which are now useless.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2020-11-09 21:40:50adminsetmessages: + msg11561
2020-11-09 21:40:50adminsetstatus: ready -> wp
2020-03-11 18:44:26adminsetmessages: + msg11159
2020-03-11 18:44:26adminsetstatus: new -> ready
2020-02-22 14:48:42adminsetmessages: + msg11141
2019-02-20 00:00:00admincreate