Skip to content

<ranges>: ranges::equal does not work for ranges with integer-class range_difference_t #3550

Description

Repro:

#include <algorithm>
#include <ranges>

using namespace std;

void f() {
  auto v = views::iota(0ull, 5ull) | views::stride(2); // range_difference_t<v> == _Unsigned128
  auto w = views::iota(0ull, 5ull) | views::stride(2);
  (void)ranges::equal(v, w);
}

Expected: correct compilation
Got: error (see link below)
Compiler explorer: https://godbolt.org/z/crcbMfY7z
Discovered while implementing #2923

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!rangesC++20/23 ranges

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions