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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Sergei Trofimovich from comment #0)
> 1. Is it expected that `gcc-14` / `gcc-master` differ in handling this code?

No

> 2. Is `T operator*();` a reasonable iterator implementaiton?

It's fine for an input iterator to return by value instead of by reference.

But it should be `T operator*() const` for any sane iterator. Non-const will
work with C++17 algorithms (like std::all_of this testcase), but not C++20
algos.

Reply via email to