[libcxx-commits] [PATCH] D144338: [libc++][ranges] Implement LWG-3860 range_common_reference_t is missing

Igor Zhukov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 18 16:44:02 PST 2023


fsb4000 created this revision.
fsb4000 added a reviewer: libc++.
fsb4000 added a project: libc++.
Herald added a project: All.
fsb4000 requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

https://cplusplus.github.io/LWG/issue3860


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144338

Files:
  libcxx/docs/Status/Cxx2bIssues.csv
  libcxx/include/__ranges/concepts.h
  libcxx/include/ranges
  libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp


Index: libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
===================================================================
--- libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
+++ libcxx/test/std/ranges/range.req/range.range/helper_aliases.compile.pass.cpp
@@ -20,6 +20,9 @@
 // template<range R>
 // using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;
 
+// template <range R>
+// using range_common_reference_t = iter_common_reference_t<iterator_t<R>>;
+
 #include <ranges>
 
 #include <concepts>
@@ -27,9 +30,8 @@
 #include "test_iterators.h"
 #include "test_range.h"
 
-
-
 static_assert(std::same_as<std::ranges::range_difference_t<test_range<cpp20_input_iterator> >, std::iter_difference_t<int*> >);
 static_assert(std::same_as<std::ranges::range_value_t<test_range<cpp20_input_iterator> >, std::iter_value_t<int*> >);
 static_assert(std::same_as<std::ranges::range_reference_t<test_range<cpp20_input_iterator> >, std::iter_reference_t<int*> >);
 static_assert(std::same_as<std::ranges::range_rvalue_reference_t<test_range<cpp20_input_iterator> >, std::iter_rvalue_reference_t<int*> >);
+static_assert(std::same_as<std::ranges::range_common_reference_t<test_range<cpp20_input_iterator> >, std::iter_common_reference_t<int*> >);
Index: libcxx/include/ranges
===================================================================
--- libcxx/include/ranges
+++ libcxx/include/ranges
@@ -49,6 +49,8 @@
     using range_reference_t = iter_reference_t<iterator_t<R>>;
   template<range R>
     using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;
+  template <range R>
+    using range_common_reference_t = iter_common_reference_t<iterator_t<R>>;
 
   // [range.sized], sized ranges
   template<class>
Index: libcxx/include/__ranges/concepts.h
===================================================================
--- libcxx/include/__ranges/concepts.h
+++ libcxx/include/__ranges/concepts.h
@@ -73,6 +73,9 @@
   template <range _Rp>
   using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>;
 
+  template <range _Rp>
+  using range_common_reference_t = iter_common_reference_t<iterator_t<_Rp>>;
+
   // [range.sized]
   template <class _Tp>
   concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); };
Index: libcxx/docs/Status/Cxx2bIssues.csv
===================================================================
--- libcxx/docs/Status/Cxx2bIssues.csv
+++ libcxx/docs/Status/Cxx2bIssues.csv
@@ -273,7 +273,7 @@
 "`3851 <https://wg21.link/LWG3851>`__","``chunk_view::inner-iterator`` missing custom ``iter_move`` and ``iter_swap``","February 2023","","","|ranges|"
 "`3853 <https://wg21.link/LWG3853>`__","``basic_const_iterator<volatile int*>::operator->`` is ill-formed","February 2023","","",""
 "`3857 <https://wg21.link/LWG3857>`__","``basic_string_view`` should allow explicit conversion when only traits vary","February 2023","|Complete|","17.0",""
-"`3860 <https://wg21.link/LWG3860>`__","``range_common_reference_t`` is missing","February 2023","","","|ranges|"
+"`3860 <https://wg21.link/LWG3860>`__","``range_common_reference_t`` is missing","February 2023","|Complete|","17.0","|ranges|"
 "`3866 <https://wg21.link/LWG3866>`__","Bad Mandates for ``expected::transform_error`` overloads","February 2023","","",""
 "`3867 <https://wg21.link/LWG3867>`__","Should ``std::basic_osyncstream``'s move assignment operator be ``noexcept``?","February 2023","","",""
 "`3441 <https://wg21.link/LWG3441>`__","Misleading note about calls to customization points","February 2023","","",""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144338.498645.patch
Type: text/x-patch
Size: 3621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230219/b0ce9431/attachment.bin>


More information about the libcxx-commits mailing list