[libcxx] [llvm] [libc++] Implement P2442R1 `std::views::chunk` (PR #171234)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 06:54:59 PST 2025


anonymouspc wrote:

> Thanks! I've merely made quick style checks as for now.

@frederick-vs-ja Thank you very much for your code review! I've applied all your suggestions in the recent new-pushed-commits. 

This is my first time contributing to libc++, if there is still anything wrong on my code, please point it out! :)

-----

> Thank you for working on this. This is just a quick review.
> 
> Please follow the guidelines: https://libcxx.llvm.org/Contributing.html#pre-commit-check-list https://libcxx.llvm.org/CodingGuidelines.html
> 
> Make sure to test `noexcept`, such as: `static_assert(noexcept(it.end()));` and for constness if applicable.

@H-G-Hristov Thank you for you code review too!
- I've adjusted the test files, now they have correct head (synopis for what being tseted, sorted includes, etc.) and correct format (the comment style, one-function-one-test, for example).
- The return-type-check are all restyled into `std::same_as<...> auto`.
  - There are still some places I use `auto meow = wolf | std::views::chunk`, I'll adjust it tomorrow.
- `nodiscard` check are all collected in `libcxx/test/libcxx/ranges/range.adaptors/range.chunk/nodiscard.verify.cpp`.
- `noexcept` are also checked.
  - There are only 5 places in P2442R1 that explicitly mentioned `noexcept`: `cpo::operator()`, `chunk_view</*excatly_input_range*/>::end() -> std::default_sentinel_t`, `chunk_range</*exactly_input_range*/>::outer_iterator::value_type::begin/end()`, `iter_move` and `iter_swap`.

-----

The CI seems to be all successful on both GCC and Clang, but failed and only failed on clang-cl. 

It will take me some time to debug the clang-cl CI failure (as I only have Linux/MacOS computers on my hand, and every time waiting for the online CI to produce a Windows-error-log, it needs more than 2 hours).

You're welcome to continue reviewing my changes! I'll appreciate any further code reviews. Thanks!

https://github.com/llvm/llvm-project/pull/171234


More information about the llvm-commits mailing list