[libcxx-commits] [PATCH] D118726: [libc++] [NFC] s/__referenceable/__can_reference/

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 2 10:40:43 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0b5fb7c604e6: [libc++] [NFC] s/__referenceable/__can_reference/ (authored by arthur.j.odwyer).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118726

Files:
  libcxx/include/__iterator/common_iterator.h
  libcxx/include/__iterator/concepts.h
  libcxx/include/__iterator/iter_move.h
  libcxx/include/__iterator/iterator_traits.h
  libcxx/include/__ranges/transform_view.h


Index: libcxx/include/__ranges/transform_view.h
===================================================================
--- libcxx/include/__ranges/transform_view.h
+++ libcxx/include/__ranges/transform_view.h
@@ -53,7 +53,7 @@
 concept __transform_view_constraints =
   view<_View> && is_object_v<_Fn> &&
   regular_invocable<_Fn&, range_reference_t<_View>> &&
-  __referenceable<invoke_result_t<_Fn&, range_reference_t<_View>>>;
+  __can_reference<invoke_result_t<_Fn&, range_reference_t<_View>>>;
 
 template<input_range _View, copy_constructible _Fn>
   requires __transform_view_constraints<_View, _Fn>
Index: libcxx/include/__iterator/iterator_traits.h
===================================================================
--- libcxx/include/__iterator/iterator_traits.h
+++ libcxx/include/__iterator/iterator_traits.h
@@ -28,13 +28,13 @@
 using __with_reference = _Tp&;
 
 template <class _Tp>
-concept __referenceable = requires {
+concept __can_reference = requires {
   typename __with_reference<_Tp>;
 };
 
 template <class _Tp>
 concept __dereferenceable = requires(_Tp& __t) {
-  { *__t } -> __referenceable; // not required to be equality-preserving
+  { *__t } -> __can_reference; // not required to be equality-preserving
 };
 
 // [iterator.traits]
@@ -147,9 +147,9 @@
 template<class _Ip>
 concept __cpp17_iterator =
   requires(_Ip __i) {
-    {   *__i } -> __referenceable;
+    {   *__i } -> __can_reference;
     {  ++__i } -> same_as<_Ip&>;
-    { *__i++ } -> __referenceable;
+    { *__i++ } -> __can_reference;
   } &&
   copyable<_Ip>;
 
Index: libcxx/include/__iterator/iter_move.h
===================================================================
--- libcxx/include/__iterator/iter_move.h
+++ libcxx/include/__iterator/iter_move.h
@@ -83,7 +83,7 @@
 } // namespace ranges
 
 template<__dereferenceable _Tp>
-  requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __referenceable; }
+  requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __can_reference; }
 using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>()));
 
 #endif // !_LIBCPP_HAS_NO_CONCEPTS
Index: libcxx/include/__iterator/concepts.h
===================================================================
--- libcxx/include/__iterator/concepts.h
+++ libcxx/include/__iterator/concepts.h
@@ -90,7 +90,7 @@
 template<class _Ip>
 concept input_or_output_iterator =
   requires(_Ip __i) {
-    { *__i } -> __referenceable;
+    { *__i } -> __can_reference;
   } &&
   weakly_incrementable<_Ip>;
 
Index: libcxx/include/__iterator/common_iterator.h
===================================================================
--- libcxx/include/__iterator/common_iterator.h
+++ libcxx/include/__iterator/common_iterator.h
@@ -148,7 +148,7 @@
       auto __tmp = *this;
       ++*this;
       return __tmp;
-    } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __referenceable; } ||
+    } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __can_reference; } ||
                          !__can_use_postfix_proxy<_Iter>) {
       return _VSTD::__unchecked_get<_Iter>(__hold_)++;
     } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118726.405360.patch
Type: text/x-patch
Size: 3114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220202/316af684/attachment-0001.bin>


More information about the libcxx-commits mailing list