[all-commits] [llvm/llvm-project] 7fb19c: [ADT] Require base equality in indexed_accessor_it...

Andrei Golubev via All-commits all-commits at lists.llvm.org
Tue Sep 10 10:30:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7fb19cb24ca154dfffa300eaac1f037b74a9539e
      https://github.com/llvm/llvm-project/commit/7fb19cb24ca154dfffa300eaac1f037b74a9539e
  Author: Andrei Golubev <andrey.golubev at intel.com>
  Date:   2024-09-10 (Tue, 10 Sep 2024)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h

  Log Message:
  -----------
  [ADT] Require base equality in indexed_accessor_iterator::operator==() (#107856)

Similarly to operator<(), equality-comparing iterators from different
ranges must really be forbidden. The preconditions for being able to do
`it1 < it2` and `it1 != it2` (or `it1 == it2` for the matter) ought to
be the same. Thus, there's little sense in keeping explicit base object
comparison in operator==() whilst having this is a precondition in
operator<() and operator-() (e.g. used for std::distance() and such).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list