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

--- Comment #21 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Luke Dalessandro from comment #15)
> 3. A fix for this issue in boost and the iterator_interface is to use a
> constrained member function rather than attempting to use a constrained
> friend function?

IIUC yes, or another less invasive workaround would be to convert the
constrained hidden friend into a template, e.g.

template<typename _Tp> concept cmpeq
  = requires(_Tp __t, _Tp __u) { { __u != __t } ; };
template<typename D>
struct iterator_interface
{
  template<class...>
  friend constexpr bool operator>=(D lhs, D rhs) requires cmpeq<D> { return
true; }
};
template<typename T>
struct iterator : iterator_interface<iterator<T>>
{
    bool operator==(iterator) const;
    iterator &operator++();
    iterator &operator++(int);
};
static_assert(cmpeq<iterator<int>>);

Reply via email to