[committed] libstdc++: Adjust std::in_range template parameter name
Checks
Commit Message
Tested x86_64-linux. Pushed to trunk.
-- >8 --
This is more consistent with the specification in the standard.
libstdc++-v3/ChangeLog:
* include/std/utility (in_range): Rename _Up parameter to _Res.
---
libstdc++-v3/include/std/utility | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
@@ -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