Skip to content

Make filter_view::iterator unwrappable - #3000

Closed
nicole mazzuca (strega-nil) wants to merge 10 commits into
microsoft:mainfrom
strega-nil:unwrappable-views
Closed

Make filter_view::iterator unwrappable#3000
nicole mazzuca (strega-nil) wants to merge 10 commits into
microsoft:mainfrom
strega-nil:unwrappable-views

Conversation

@strega-nil

@strega-nil nicole mazzuca (strega-nil) commented Aug 6, 2022

Copy link
Copy Markdown
Contributor

This is an example of what we might do; it definitely requires discussion.

In theory, with more work, fixes #2997

Based on #2991

@strega-nil
nicole mazzuca (strega-nil) requested a review from a team as a code owner August 6, 2022 17:29
@strega-nil nicole mazzuca (strega-nil) changed the title Unwrappable view iterators Make filter_view::iterator unwrappable Aug 6, 2022
@strega-nil
nicole mazzuca (strega-nil) marked this pull request as draft August 6, 2022 17:44
Comment thread stl/inc/xutility Outdated
template <class _Iter>
using _Unwrapped_t = _Remove_cvref_t<decltype(_Get_unwrapped(_STD declval<_Iter>()))>;
template <class _Iter, bool _Is_unwrapped>
using _Maybe_unwrapped_t = conditional_t<_Is_unwrapped, _Unwrapped_t<_Iter>, _Remove_cvref_t<_Iter>>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse _Maybe_wrapped?

STL/stl/inc/ranges

Lines 60 to 61 in 3e046a4

template <bool _IsWrapped, class _Ty>
using _Maybe_wrapped = conditional_t<_IsWrapped, _Ty, _Unwrapped_t<_Ty>>;

still need unwrappable sentinel
@strega-nil-ms

Copy link
Copy Markdown
Contributor

Closing for now; this requires a lot of underlying machinery to be defined, and we can do that work in algorithms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Many view iterators do not contain an _Unwrapped() member function

4 participants