https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120789

            Bug ID: 120789
           Summary: ranges::unique should use ranges​::​iter_move
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

#include <algorithm>

struct A {
  bool operator==(const A&) const;
};

struct B {
  B(B&&) = delete;
  B& operator=(const A&) const;

  operator A() const;
  bool operator==(const B&) const;
};

struct I {
  using value_type = A;
  using difference_type = int;
  B operator*() const;
  I& operator++();
  I operator++(int);
  bool operator==(const I&) const;
  friend A iter_move(const I&);
};

int main() {
  std::ranges::subrange<I, I> r;
  auto [begin, end] = std::ranges::unique(r);
}

https://godbolt.org/z/oxabhvjE4

Reply via email to