[libcxx-commits] [PATCH] D118400: [libc++] Remove operator-> from the iterator archetypes

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 27 12:57:47 PST 2022


Quuxplusone requested changes to this revision.
Quuxplusone added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/test/support/test_iterators.h:253-264
+namespace std {
+    template <class It>
+    struct pointer_traits<::contiguous_iterator<It>> {
+        using pointer = ::contiguous_iterator<It>;
+        using element_type = typename pointer_traits<It>::element_type;
+        using difference_type = typename pointer_traits<It>::difference_type;
+        template <class Other>
----------------
(A) please don't reopen namespace std, but also (B) please don't specialize `pointer_traits`.
Is your goal just to make `contiguous_iterator` a contiguous iterator while (for some reason) removing its `operator->`? You can do that by giving `contiguous_iterator` a member `using element_type = typename pointer_traits<It>::element_type;`.
https://stackoverflow.com/questions/65712091/in-c20-how-do-i-write-a-contiguous-iterator



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118400



More information about the libcxx-commits mailing list