File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -2049,17 +2049,12 @@ inline void _Buffer_to_uppercase(char* _Begin, const char* _End) {
20492049 }
20502050}
20512051
2052+ template <class _Ty>
2053+ using _Make_standard_integer = conditional_t<is_signed_v<_Ty>, make_signed_t<_Ty>, make_unsigned_t<_Ty>>;
2054+
20522055template <class _CharT, integral _Ty>
20532056_NODISCARD constexpr bool _In_bounds(const _Ty _Value) {
2054- if constexpr (is_unsigned_v<_CharT> && is_unsigned_v<_Ty>) {
2055- return _Value <= (numeric_limits<_CharT>::max)();
2056- } else if constexpr (is_unsigned_v<_CharT>) {
2057- return _Value >= 0 && static_cast<make_unsigned_t<_Ty>>(_Value) <= (numeric_limits<_CharT>::max)();
2058- } else if constexpr (is_unsigned_v<_Ty>) {
2059- return _Value <= static_cast<make_unsigned_t<_CharT>>((numeric_limits<_CharT>::max)());
2060- } else {
2061- return (numeric_limits<_CharT>::min)() <= _Value && _Value <= (numeric_limits<_CharT>::max)();
2062- }
2057+ return _STD in_range<_Make_standard_integer<_CharT>>(static_cast<_Make_standard_integer<_Ty>>(_Value));
20632058}
20642059
20652060_NODISCARD inline int _Count_separators(size_t _Digits, const string_view _Groups) {
You can’t perform that action at this time.
0 commit comments