public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-11126] libstdc++: Adjust std::in_range template parameter name
@ 2023-12-06 21:01 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-12-06 21:01 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-06 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 21:01 [gcc r11-11126] libstdc++: Adjust std::in_range template parameter name Jonathan Wakely

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).