diff options
author | Arslan Urtashev <urtashev@gmail.com> | 2022-02-10 16:48:55 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:55 +0300 |
commit | 1136f2ce7cce7bcc84e695272c0d92d4eb900c2b (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string | |
parent | b97740540e7302cec9efa181e106ae1990a0cc1c (diff) | |
download | ydb-1136f2ce7cce7bcc84e695272c0d92d4eb900c2b.tar.gz |
Restoring authorship annotation for Arslan Urtashev <urtashev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/string')
-rw-r--r-- | util/string/ascii.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/util/string/ascii.h b/util/string/ascii.h index 5ad6db1eff..10344384d3 100644 --- a/util/string/ascii.h +++ b/util/string/ascii.h @@ -27,36 +27,36 @@ namespace NPrivate { extern const unsigned char ASCII_LOWER[256]; template <class T> - struct TDereference { - using type = T; + struct TDereference { + using type = T; }; #ifndef TSTRING_IS_STD_STRING template <class String> - struct TDereference<TBasicCharRef<String>> { - using type = typename String::value_type; + struct TDereference<TBasicCharRef<String>> { + using type = typename String::value_type; }; #endif template <class T> - using TDereferenced = typename TDereference<T>::type; - + using TDereferenced = typename TDereference<T>::type; + template <class T> - bool RangeOk(T c) noexcept { - static_assert(std::is_integral<T>::value, "Integral type character expected"); - + bool RangeOk(T c) noexcept { + static_assert(std::is_integral<T>::value, "Integral type character expected"); + if (sizeof(T) == 1) { - return true; + return true; } - - return c >= static_cast<T>(0) && c <= static_cast<T>(127); + + return c >= static_cast<T>(0) && c <= static_cast<T>(127); } - + #ifndef TSTRING_IS_STD_STRING template <class String> - bool RangeOk(const TBasicCharRef<String>& c) { - return RangeOk(static_cast<typename String::value_type>(c)); - } + bool RangeOk(const TBasicCharRef<String>& c) { + return RangeOk(static_cast<typename String::value_type>(c)); + } #endif } |