public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5560] libstdc++: Adjust std::in_range template parameter name
@ 2023-11-17 14:49 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-11-17 14:49 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:97fc8851f60fda381ac3bf6213a1cc93d9fda4f0
commit r14-5560-g97fc8851f60fda381ac3bf6213a1cc93d9fda4f0
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.
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 18bef7adccd..5d5fcc7da73 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -171,22 +171,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);
}
#endif // __cpp_lib_integer_comparison_functions
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-17 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 14:49 [gcc r14-5560] 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).