[libcxx-commits] [libcxx] WIP [libc++][ranges] P3059R2: Making user-defined constructors of view iterators/sentinels private (PR #193891)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 20 03:07:59 PDT 2026


================
@@ -82,7 +81,10 @@ constexpr bool test() {
     using MoveOnlyElemIter =
         std::ranges::iterator_t<std::ranges::elements_view<std::ranges::subrange<MoveOnlyIter, Sent>, 0>>;
 
----------------
frederick-vs-ja wrote:

Also, I don't think this PR should be of WIP status for so long. IIUC we just need to add some `static_assert(!std::is_constructible_v<...>);` and possibly `static_assert(!std::is_convertible_v<...>);` to verify that we've achieved (some aspects of) the intent of the P3059R2.

In a future PR we may make some internal constructors take `View*` instead of `View&`, which will slightly reduce calls to `std::addressof` and slightly save throughput.

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


More information about the libcxx-commits mailing list