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

<ranges>: Fix dispatching for views::counted #5223

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

frederick-vs-ja
Copy link
Contributor

Fixes #5183 (which is a bit beyond good first issue, IMO).

Drive-by changes:

  • Fixing test::redifference_iterator, which should always have iterator_concept.
  • Cleaning up using-declarations in P0896R4_views_counted/test.cpp.

There's a bug of MSVC which forbids using ranges::contiguous_range; contiguous_range auto cat = meow(); to work. I've reported DevCom-10823410 for it.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner January 6, 2025 09:46
@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Jan 6, 2025
using value_type = std::iter_value_t<It>;
using difference_type = Diff;
using value_type = std::iter_value_t<It>;
using difference_type = Diff;

redifference_iterator() = default;
constexpr explicit redifference_iterator(It it) : i_{std::move(it)} {}
Copy link
Member

Choose a reason for hiding this comment

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

There are x64 test failures, separate from the x86 AV problem that's currently blocking all PR checks:

"C:\a\_work\1\s\tests\std\include\range_algorithm_support.hpp", line 989:
          error: "i_" is not a nonstatic data member or base class of class
          "test::redifference_iterator<std::_Signed128,

Copy link
Member

Choose a reason for hiding this comment

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

P0896R4_views_counted is still failing. As a reminder, it's always a good idea to rerun a failing test locally before pushing changes.

Copy link
Contributor Author

@frederick-vs-ja frederick-vs-ja Jan 8, 2025

Choose a reason for hiding this comment

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

Oh, this is perphaps DevCom-10735214. The workaround seems to be making the function templates non-abbreviated. I'll verify whether such workaround suffices later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ranges C++20/23 ranges
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

<ranges>: views::counted::_Choose() misses difference casting for contiguous_iterator case
2 participants