diff --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h --- a/libcxx/include/__ranges/size.h +++ b/libcxx/include/__ranges/size.h @@ -89,7 +89,7 @@ template<__difference _Tp> [[nodiscard]] constexpr __integer_like auto operator()(_Tp&& __t) const noexcept(noexcept(ranges::end(__t) - ranges::begin(__t))) { - return __to_unsigned_like>>( + return __to_unsigned>>( ranges::end(__t) - ranges::begin(__t)); } }; diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -331,13 +331,6 @@ return _Tp(~__x + 1); } -template -inline _LIBCPP_INLINE_VISIBILITY typename make_unsigned<_Tp>::type -__to_unsigned(_Tp __x) -{ - return static_cast::type>(__x); -} - template _LIBCPP_AVAILABILITY_TO_CHARS inline _LIBCPP_INLINE_VISIBILITY to_chars_result diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -2309,12 +2309,13 @@ #if _LIBCPP_STD_VER > 11 template using make_unsigned_t = typename make_unsigned<_Tp>::type; +#endif -template -[[nodiscard]] constexpr auto __to_unsigned_like(_From __x) noexcept { - return static_cast>(__x); +template +_LIBCPP_NODISCARD_ATTRIBUTE _LIBCPP_INLINE_VISIBILITY constexpr +typename make_unsigned<_Tp>::type __to_unsigned(_Tp __x) noexcept { + return static_cast::type>(__x); } -#endif #if _LIBCPP_STD_VER > 14 template using void_t = void;