[libcxx-commits] [PATCH] D129099: [libcxx][ranges] Create a test tool `ProxyIterator` that customises `iter_move` and `iter_swap`

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 5 08:24:33 PDT 2022


philnik accepted this revision as: philnik.
philnik added a comment.

LGTM % nits.



================
Comment at: libcxx/test/support/test_iterators.h:20-24
+#if TEST_STD_VER > 17
+// for ProxyIterator
+#include <ranges>
+#include <type_traits>
+#endif
----------------
I don't think we need to guard the includes here. If you want to avoid depending on transitive includes we should probably add a modulemap. I'll make a PR for that. Sounds like a good idea either way.


================
Comment at: libcxx/test/support/test_iterators.h:819-825
+  friend constexpr T& getData(Proxy& p) { return p.data; }
+
+  friend constexpr const T& getData(const Proxy& p) { return p.data; }
+
+  friend constexpr T&& getData(Proxy&& p) { return static_cast<T&&>(p.data); }
+
+  friend constexpr const T&& getData(const Proxy&& p) { return static_cast<const T&&>(p.data); }
----------------
Why aren't these member functions?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129099



More information about the libcxx-commits mailing list