[libcxx-commits] [PATCH] D105040: [libc++] NFCI: Remove code duplication and obsolete declarations in wrap_iter

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 10 19:59:51 PDT 2021


Quuxplusone added a comment.

Amusing comment in GNU libstdc++ about this.
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/stl_iterator.h#L1081-L1087

It appears that the state-of-the-art fix is that we need to provide //both//

  template <class _Iter1>
  bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
  {
      return !(__x == __y);
  }
  
  template <class _Iter1, class _Iter2>
  bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
  {
      return !(__x == __y);
  }

and so on. The single-`_Iter1` versions are precisely the bits @ldionne removed. I hadn't even noticed they were there! We should put them back, plus a test case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105040/new/

https://reviews.llvm.org/D105040



More information about the libcxx-commits mailing list