[libcxx-commits] [PATCH] D101404: [libcxx] Fix __wrap_iter to work with to_address.

Tim Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 29 05:09:53 PDT 2021


tcanens added inline comments.


================
Comment at: libcxx/include/iterator:1280
     typedef typename iterator_traits<iterator_type>::pointer           pointer;
+    typedef typename pointer_traits<pointer>::element_type             element_type;
     typedef typename iterator_traits<iterator_type>::reference         reference;
----------------
zoecarver wrote:
> Quuxplusone wrote:
> > If my comments are correct, then this could+should use `pointer_traits<_Iter>` instead of `pointer_traits<pointer>`...
> > ...and the `_If` on line 1284 is unconditionally true, and can be simplified.
> > Please try that simplification (at least locally) and see if it passes the test suite.
> Alternatively we could add `element_type` with an `_If` (or maybe inheritance?) to make this work for non-pointer-like iterators. 
It's surprising to me that this is even needed. What breaks without this change?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101404



More information about the libcxx-commits mailing list