diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
commit | 54c2e44d7b37b2c3efc449e054eef21fa414dfde (patch) | |
tree | 3894ba7e10c78750c195381a861da5e8166a6bfd /zen/string_traits.h | |
parent | Merge branch 'b11.20' into 'master' (diff) | |
parent | add upstream 11.21 (diff) | |
download | FreeFileSync-11.21.tar.gz FreeFileSync-11.21.tar.bz2 FreeFileSync-11.21.zip |
Merge branch 'b11.21' into 'master'11.21
add upstream 11.21
See merge request opensource-tracking/FreeFileSync!44
Diffstat (limited to 'zen/string_traits.h')
-rw-r--r-- | zen/string_traits.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/zen/string_traits.h b/zen/string_traits.h index ca40f7d6..1a4f4740 100644 --- a/zen/string_traits.h +++ b/zen/string_traits.h @@ -15,9 +15,9 @@ //uniform access to string-like types, both classes and character arrays namespace zen { -/* IsStringLikeV<>: - IsStringLikeV<const wchar_t*> //equals "true" - IsStringLikeV<const int*> //equals "false" +/* isStringLike<>: + isStringLike<const wchar_t*> //equals "true" + isStringLike<const int*> //equals "false" GetCharTypeT<>: GetCharTypeT<std::wstring> //equals wchar_t @@ -51,7 +51,7 @@ template <class Iterator> auto makeStringView(Iterator first, size_t len); //---------------------- implementation ---------------------- namespace impl { -template<class S, class Char> //test if result of S::c_str() can convert to const Char* +template <class S, class Char> //test if result of S::c_str() can convert to const Char* class HasConversion { using Yes = char[1]; @@ -105,9 +105,9 @@ class StringTraits public: enum { - isStringClass = HasMemberTypeV_value_type<CleanType>&& - HasMemberV_c_str <CleanType>&& - HasMemberV_length <CleanType> + isStringClass = hasMemberType_value_type<CleanType> && + hasMember_c_str <CleanType> && + hasMember_length <CleanType> }; using CharType = typename GetCharTypeImpl<UndecoratedType, isStringClass>::Type; @@ -121,10 +121,10 @@ public: } -template<class T> -constexpr bool IsStringLikeV = impl::StringTraits<T>::isStringLike; +template <class T> +constexpr bool isStringLike = impl::StringTraits<T>::isStringLike; -template<class T> +template <class T> using GetCharTypeT = typename impl::StringTraits<T>::CharType; @@ -184,7 +184,7 @@ inline size_t strLength(const std::basic_string_view<const wchar_t>& ref) { retu template <class S> inline auto strBegin(S&& str) { - static_assert(IsStringLikeV<S>); + static_assert(isStringLike<S>); return impl::strBegin(std::forward<S>(str)); } @@ -192,7 +192,7 @@ auto strBegin(S&& str) template <class S> inline size_t strLength(S&& str) { - static_assert(IsStringLikeV<S>); + static_assert(isStringLike<S>); return impl::strLength(std::forward<S>(str)); } |