public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [PATCH] libstdc++: Rename disable_sized_sentinel [P1871R1]
Date: Thu, 14 Nov 2019 16:52:00 -0000	[thread overview]
Message-ID: <20191114165237.GA32495@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

	* include/bits/iterator_concepts.h (disable_sized_sentinel): Rename to
	disable_sized_sentinel_for.
	* testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust.

Tested powerpc64le-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 3198 bytes --]

commit 3a7f3e87680cc0ca20318b0983d517cd32851fc5
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 13 22:27:59 2019 +0000

    libstdc++: Rename disable_sized_sentinel [P1871R1]
    
            * include/bits/iterator_concepts.h (disable_sized_sentinel): Rename to
            disable_sized_sentinel_for.
            * testsuite/24_iterators/headers/iterator/synopsis_c++20.cc: Adjust.

diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h
index 8b398616a56..7cc058eb8c9 100644
--- a/libstdc++-v3/include/bits/iterator_concepts.h
+++ b/libstdc++-v3/include/bits/iterator_concepts.h
@@ -524,11 +524,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       && __detail::__weakly_eq_cmp_with<_Sent, _Iter>;
 
   template<typename _Sent, typename _Iter>
-    inline constexpr bool disable_sized_sentinel = false;
+    inline constexpr bool disable_sized_sentinel_for = false;
 
   template<typename _Sent, typename _Iter>
     concept sized_sentinel_for = sentinel_for<_Sent, _Iter>
-    && !disable_sized_sentinel<remove_cv_t<_Sent>, remove_cv_t<_Iter>>
+    && !disable_sized_sentinel_for<remove_cv_t<_Sent>, remove_cv_t<_Iter>>
     && requires(const _Iter& __i, const _Sent& __s)
     {
       { __s - __i } -> same_as<iter_difference_t<_Iter>>;
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index 411feba90e0..a707621c9ed 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -449,9 +449,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #  if __cplusplus > 201703L && defined __cpp_lib_concepts
   template<typename _Iterator1, typename _Iterator2>
     requires (!sized_sentinel_for<_Iterator1, _Iterator2>)
-    inline constexpr bool disable_sized_sentinel<reverse_iterator<_Iterator1>,
-						 reverse_iterator<_Iterator2>>
-						   = true;
+    inline constexpr bool
+    disable_sized_sentinel_for<reverse_iterator<_Iterator1>,
+			       reverse_iterator<_Iterator2>> = true;
 #  endif // C++20
 # endif // C++14
 
diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
index 824b0b4f38c..fb3bb420a54 100644
--- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
+++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
@@ -79,7 +79,7 @@ namespace std
 }
 
 struct I { };
-template<> constexpr bool std::disable_sized_sentinel<I, I> = true;
+template<> constexpr bool std::disable_sized_sentinel_for<I, I> = true;
 
 namespace __gnu_test
 {
@@ -87,8 +87,8 @@ namespace __gnu_test
   constexpr auto* iter_move = &std::ranges::iter_move;
   constexpr auto* iter_swap = &std::ranges::iter_swap;
   // sized sentinels
-  constexpr bool const* disable_sized_sentinel
-    = &std::disable_sized_sentinel<void, void>;
+  constexpr bool const* disable_sized_sentinel_for
+    = &std::disable_sized_sentinel_for<void, void>;
   // default sentinels
   constexpr std::default_sentinel_t const* default_sentinel
     = &std::default_sentinel;

                 reply	other threads:[~2019-11-14 16:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191114165237.GA32495@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).