[libcxx-commits] [PATCH] D103056: [libcxx][ranges] Add `ranges::transform_view`.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 23 12:33:16 PDT 2021


zoecarver marked 3 inline comments as done.
zoecarver added a comment.

- Also splitting the tests here and generally applying the comment from drop_view.



================
Comment at: libcxx/include/__ranges/transform_view.h:103-118
+template<class _View>
+struct __iterator_concept {
+  using type = conditional_t<
+    random_access_range<_View>,
+    random_access_iterator_tag,
+    conditional_t<
+      bidirectional_range<_View>,
----------------
cjdb wrote:
> Probably better to take my one from D101922. It's easier to read and doesn't result in a lot of unnecessary instantiations.
Sorry, can you be more specific, where should I find the simpler `__iterator_concept` type?


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.transform/range.transform.view.pass.cpp:21
+#include <string>
+#include <iostream>
+#include <cctype>
----------------
Remove this.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.transform/range.transform.view.pass.cpp:70-75
+struct ForwardRange {
+  ForwardIter begin() const;
+  ForwardIter end() const;
+  ForwardIter begin();
+  ForwardIter end();
+};
----------------
cjdb wrote:
> See `test/support/test_range.h`
Those aren't views. 


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.transform/range.transform.view.pass.cpp:115
+
+struct SentinelView : std::ranges::view_base {
+  int count;
----------------
cjdb wrote:
> `InputView` is a sentinel view?
Renamed to `SizedSentinelView`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103056



More information about the libcxx-commits mailing list