Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ranges::iota_view #1693

Merged
merged 2 commits into from
Feb 26, 2021
Merged

Conversation

CaseyCarter
Copy link
Member

@CaseyCarter CaseyCarter commented Feb 24, 2021

Also rework the implementation of P1739R4 to propose as a resolution for LWG-3407, and implement the resolution of LWG-3523.

Rework the implementation of P1739R4 to propose as a resolution for LWG-3407; implement the resolution of LWG-3523.
@CaseyCarter CaseyCarter added cxx20 C++20 feature ranges C++20/23 ranges labels Feb 24, 2021
@CaseyCarter CaseyCarter requested a review from a team as a code owner February 24, 2021 04:19
#endif // TRANSITION, DevCom-1347136

constexpr _Ioterator& operator+=(const difference_type _Off)
#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1347136
Copy link
Member Author

Choose a reason for hiding this comment

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

DevCom-1347136 is fun: the compiler warns about possible loss of data narrowing _Off in noexcept(_Current += _Off) (Yes, loss of data in an unevaluated operand.)

@CaseyCarter CaseyCarter mentioned this pull request Feb 24, 2021
stl/inc/ranges Outdated Show resolved Hide resolved
Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

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

Looks good, all I found were nitpicks!

stl/inc/ranges Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
tests/std/tests/P0896R4_views_iota/test.cpp Show resolved Hide resolved
tests/std/tests/P0896R4_views_iota/test.cpp Show resolved Hide resolved
tests/std/tests/P0896R4_views_iota/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P0896R4_views_iota/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/P0896R4_views_iota/test.cpp Show resolved Hide resolved
stl/inc/ranges Outdated Show resolved Hide resolved
stl/inc/ranges Show resolved Hide resolved
static_assert(same_as<ranges::range_difference_t<R>, long long>);
}

{
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there some condition missing here?

I do not really see the benefit of that scope, as there are no other variables defined here

Copy link
Member Author

Choose a reason for hiding this comment

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

Mostly the braces are here (as on other blocks) to wrap this up in a nicely self-contained chunk. It's probably my lizard brain telling me to factor this overlarge function out into separate small and simple functions. That said I acknowledge that removing this pair of braces reduces indentation but has no semantic effect. I can strike them if you think it's an improvement.

@StephanTLavavej
Copy link
Member

1, 2, 3, 4, thank you for adding more, 5, 6, 7, 8, views in <ranges> are super great! 😻 🚀 🔢

@CaseyCarter CaseyCarter deleted the iota_view branch March 17, 2021 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx20 C++20 feature ranges C++20/23 ranges
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants