Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++23 status.

3860.range_common_reference_t is missing

Section: 25.2[ranges.syn]Status:C++23Submitter: Hewill KangOpened: 2023-01-24Last modified: 2023-11-22

Priority:Not Prioritized

View otheractive issues in [ranges.syn].

View all otherissues in [ranges.syn].

View all issues withC++23 status.

Discussion:

For the alias templateiter_meow_t in<iterator>, there are almost all correspondingrange_meow_t in<ranges>, except foriter_common_reference_t, which is used to calculate the common reference type shared byreference andvalue_type of the iterator.

Given that it has a highly similar formula form toiter_const_reference_t, and the latter has a corresponding sibling, I think we should add arange_common_reference_t for<ranges>.

This increases the consistency of the two libraries and simplifies the text of getting common reference from a range. Since C++23 brings proxy iterators andtuple enhancements, I believe such introduction can bring some value.

[2023-02-06; Reflector poll]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

[2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative toN4928.

  1. Modify 25.2[ranges.syn], header<ranges> synopsis, as indicated:

    #include <compare>              //see 17.12.1[compare.syn]#include <initializer_list>     //see 17.11.2[initializer.list.syn]#include <iterator>             //see 24.2[iterator.synopsis]namespace std::ranges {  […]  template<range R>    using range_reference_t = iter_reference_t<iterator_t<R>>;                      //freestanding  template<range R>    using range_const_reference_t = iter_const_reference_t<iterator_t<R>>;          //freestanding  template<range R>    using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;        //freestandingtemplate<range R>    using range_common_reference_t = iter_common_reference_t<iterator_t<R>>;        //freestanding  […]}

[8]ページ先頭

©2009-2026 Movatter.jp