Skip to content

P3059R2: Making user-defined constructors of view iterators/sentinels private. - #6382

Open
Iskandar Emomzoda (iskandarem) wants to merge 41 commits into
microsoft:mainfrom
iskandarem:unable-view-sentinel-iterator-creation-from-outside
Open

P3059R2: Making user-defined constructors of view iterators/sentinels private. #6382
Iskandar Emomzoda (iskandarem) wants to merge 41 commits into
microsoft:mainfrom
iskandarem:unable-view-sentinel-iterator-creation-from-outside

Conversation

@iskandarem

@iskandarem Iskandar Emomzoda (iskandarem) commented Jul 26, 2026

Copy link
Copy Markdown
Contributor
  • User defined constructors for following view-iterators/sentinels made private:

    • filter_view::iterator/sentinel
    • basic_istream_view::iterator
    • transform_view::iterator/sentinel
    • take_view::sentinel
    • take_while_view::sentinel
    • join_view::sentinel
    • lazy_split_view::outer_iterator
    • lazy_split_view::inner_iterator
    • split_view::iterator/sentinel
    • element_view::iterator/sentinel
    • iota_view::_Ioterator
  • Removed the _Iotinel and replaced it with a nested iota_view::_Sentinel. This avoids changing the ABI of the existing _Ioinel type while making the implementation closer to the Standard wording.

    • iota_view::_Sentinel

closes #6241

Copilot AI balanced review requested due to automatic review settings July 26, 2026 18:06
@iskandarem
Iskandar Emomzoda (iskandarem) requested a review from a team as a code owner July 26, 2026 18:06
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Jul 26, 2026
@azure-pipelines

This comment was marked as resolved.

This comment was marked as resolved.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Initial Review to Work In Progress in STL Code Reviews Jul 26, 2026
Copilot AI review requested due to automatic review settings July 26, 2026 18:14
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added cxx20 C++20 feature ranges C++20/23 ranges defect report Applied retroactively labels Jul 26, 2026
@StephanTLavavej

This comment was marked as resolved.

This comment was marked as resolved.

@iskandarem

This comment was marked as resolved.

@iskandarem
Iskandar Emomzoda (iskandarem) marked this pull request as draft July 26, 2026 18:50
@StephanTLavavej

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings July 27, 2026 08:51

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings July 27, 2026 09:01

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings July 27, 2026 11:55

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings July 27, 2026 12:38
@iskandarem

This comment was marked as resolved.

This comment was marked as resolved.

@StephanTLavavej

This comment was marked as resolved.

@StephanTLavavej

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 6, 2026 12:40

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 6, 2026 14:19

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings August 6, 2026 21:06

This comment was marked as resolved.

A. Jiang (frederick-vs-ja) referenced this pull request in llvm/llvm-project Aug 7, 2026
…erators/sentinels private (#193891)

Implements https://wg21.link/P3059R2 (DR)

Closes #189599

1. Made constructors of iterator and sentinel types of the following
views private:
  - `iota_view`
  - `basic_istream_view`
  - `filter_view`
  - `transform_view`
  - `take_view`
  - `take_while_view`
  - `join_view`
  - `lazy_split_view`
  - `split_view`
  - `elements_view`
2. Updated all relevant tests to fix the usages of the now private
constructor, including:
   1. Removed now obsolete tests (files and cases).
2. Updated all relevant tests to get the iterators and the sentinels via
`begin()` and `end()`, wherever applicable .
   3. Added test cases to confirm that P3059R2 was implemented properly.
   4. Minor other (necessary) tweaks.

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
Co-authored-by: A. Jiang <de34@live.cn>
Comment thread stl/debugger/STL.natvis
Copilot AI review requested due to automatic review settings August 7, 2026 09:50

This comment was marked as resolved.

Comment thread tests/libcxx/expected_results.txt Outdated
Copilot AI review requested due to automatic review settings August 13, 2026 11:53

This comment was marked as resolved.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) moved this from Work In Progress to Initial Review in STL Code Reviews Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx20 C++20 feature defect report Applied retroactively ranges C++20/23 ranges

Projects

Status: Initial Review

Development

Successfully merging this pull request may close these issues.

P3059R2 Making User-Defined Constructors Of View Iterators/Sentinels private

5 participants