[libcxx-commits] [PATCH] D116614: [libc++] Refactor the test for join_view's default constructor

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 10 06:02:10 PST 2022


ldionne added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp:30
+constexpr void test_default_constructible() {
+  using JoinedView = std::ranges::join_view<view<Iter>>;
+  using JoinIterator = std::ranges::iterator_t<JoinedView>;
----------------
Quuxplusone wrote:
> Rename to `JoinView`? (I don't understand whatever distinction you're making between `JoinX` and `JoinedX`.)
> Throughout, I'd rename `Iter` -> `It`, and in fact I'd get rid of the custom `view` helper class in favor of `std::subrange`:
> ```
> template <class It>
> constexpr void test_default_constructible() {
>   using View = std::subrange<It, sentinel_wrapper<It>>;
>   using JoinIterator = std::ranges::iterator_t<std::ranges::join_view<View>>;
>   static_assert(std::is_default_constructible_v<JoinIterator>);
>   JoinIterator it; (void)it;
> }
> ```
> Likewise below.
There's no distinction between `JoinedView` and `JoinView`, just my own inconsistency. Thanks for spotting. I'm also fine with renaming `Iter` to `It`, but I'll keep `view` instead of `std::subrange` in order to keep the test as minimal as possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116614



More information about the libcxx-commits mailing list