Skip to content

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

@JMazurkiewicz

Description

@JMazurkiewicz

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

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