[libcxx-commits] [PATCH] D110774: [libc++] [ranges] Uncomment transform_view::iterator::operator<=>.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 29 13:36:12 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__ranges/transform_view.h:266-271
   _LIBCPP_HIDE_FROM_ABI
   friend constexpr bool operator==(const __iterator& __x, const __iterator& __y)
     requires equality_comparable<iterator_t<_Base>>
   {
     return __x.__current_ == __y.__current_;
   }
----------------
I wonder if we should just replace this function body with `= default` instead. The only user-visible difference would be that it would become implicitly `noexcept(auto)` instead of `noexcept(false)`.


================
Comment at: libcxx/include/__ranges/transform_view.h:278
     return __x.__current_ < __y.__current_;
   }
 
----------------
Unfortunately, I am //not// convinced that it would be conforming to eliminate these redundant relational operators in the case that `operator<=>` exists. The user might have some clever way of observing whether it was actual-`operator<` or rewritten-candidate-`operator<=>` getting called. At least I'm not convinced that no such cleverness exists.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110774



More information about the libcxx-commits mailing list