public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-11126] libstdc++: Adjust std::in_range template parameter name
Date: Wed,  6 Dec 2023 21:01:15 +0000 (GMT)	[thread overview]
Message-ID: <20231206210115.E56EE385828B@sourceware.org> (raw)

https://gcc.gnu.org/g:87288696a2394cf8092d376e1db315e149a6f5b7

commit r11-11126-g87288696a2394cf8092d376e1db315e149a6f5b7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 17 12:18:17 2023 +0000

    libstdc++: Adjust std::in_range template parameter name
    
    This is more consistent with the specification in the standard.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/utility (in_range): Rename _Up parameter to _Res.
    
    (cherry picked from commit 97fc8851f60fda381ac3bf6213a1cc93d9fda4f0)

Diff:
---
 libstdc++-v3/include/std/utility | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility
index 7ebb8a552c1..4c288c6024d 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -443,22 +443,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     cmp_greater_equal(_Tp __t, _Up __u) noexcept
     { return !std::cmp_less(__t, __u); }
 
-  template<typename _Up, typename _Tp>
+  template<typename _Res, typename _Tp>
     constexpr bool
     in_range(_Tp __t) noexcept
     {
-      static_assert(__is_standard_integer<_Up>::value);
+      static_assert(__is_standard_integer<_Res>::value);
       static_assert(__is_standard_integer<_Tp>::value);
       using __gnu_cxx::__int_traits;
 
-      if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
-	return __int_traits<_Up>::__min <= __t
-	  && __t <= __int_traits<_Up>::__max;
+      if constexpr (is_signed_v<_Tp> == is_signed_v<_Res>)
+	return __int_traits<_Res>::__min <= __t
+	  && __t <= __int_traits<_Res>::__max;
       else if constexpr (is_signed_v<_Tp>)
 	return __t >= 0
-	  && make_unsigned_t<_Tp>(__t) <= __int_traits<_Up>::__max;
+	  && make_unsigned_t<_Tp>(__t) <= __int_traits<_Res>::__max;
       else
-	return __t <= make_unsigned_t<_Up>(__int_traits<_Up>::__max);
+	return __t <= make_unsigned_t<_Res>(__int_traits<_Res>::__max);
     }
 
 #if __cplusplus > 202002L

                 reply	other threads:[~2023-12-06 21:01 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=20231206210115.E56EE385828B@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).