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

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 29 10:51:03 PDT 2021


zoecarver marked 5 inline comments as done.
zoecarver added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:45
+  return std::ranges::transform_view(a, [&a, &b, join](auto& x) {
+    auto idx = (&x) - a;
+    return join(x, b[idx]);
----------------
Quuxplusone wrote:
> Is the point of this test to verify that `x` is in fact a reference into the original viewed range, and not a copy? If so, this could be more explicit. If not, then again this seems overly confusing and complicated.
Marking this and the one above as done. I think I commented elsewhere: the point of this test isn't to test any one thing in particular, it's just to have some general function implemented in ways that this might be used in the wild. 


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:50-54
+template<>
+constexpr bool std::ranges::enable_view<std::vector<int>> = true;
+
+template<>
+constexpr bool std::ranges::enable_view<std::string_view> = true;
----------------
Quuxplusone wrote:
> I assume lines 50-54 were here for polyfill purposes; they can be removed now that `enable_view` is in master, right?
Unfortunately not yet. We still need to actually //use// `enable_view` on main.


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