diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-12-14 15:52:53 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-12-14 15:52:53 +0000 |
commit | cc75e50ca861529d50601d247fd66f806fcb23a8 (patch) | |
tree | e2c5c7b1f98e64011b1ee8ca4e9bb9157510dfe7 /zen/string_traits.h | |
parent | Merge branch '10.17' into 'master' (diff) | |
parent | add upstream 10.18 (diff) | |
download | FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.gz FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.bz2 FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.zip |
Merge branch '10.18' into 'master'10.18
add upstream 10.18
See merge request opensource-tracking/FreeFileSync!15
Diffstat (limited to 'zen/string_traits.h')
-rw-r--r-- | zen/string_traits.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/zen/string_traits.h b/zen/string_traits.h index d0f34d54..f1269130 100644 --- a/zen/string_traits.h +++ b/zen/string_traits.h @@ -92,14 +92,18 @@ template <> struct GetCharTypeImpl<std::basic_string_view<const char >, false> template <> struct GetCharTypeImpl<std::basic_string_view<const wchar_t>, false> { using Type = wchar_t; }; -ZEN_INIT_DETECT_MEMBER_TYPE(value_type); -ZEN_INIT_DETECT_MEMBER(c_str); //we don't know the exact declaration of the member attribute and it may be in a base class! -ZEN_INIT_DETECT_MEMBER(length); // +ZEN_INIT_DETECT_MEMBER_TYPE(value_type) +ZEN_INIT_DETECT_MEMBER(c_str) //we don't know the exact declaration of the member attribute and it may be in a base class! +ZEN_INIT_DETECT_MEMBER(length) // template <class S> class StringTraits { - using CleanType = std::remove_cv_t<std::remove_reference_t<S>>; //std::remove_cvref requires C++20 +#if __cpp_lib_remove_cvref + using CleanType = std::remove_cvref_t<S>; +#else + using CleanType = std::remove_cv_t<std::remove_reference_t<S>>; +#endif using NonArrayType = std::remove_extent_t <CleanType>; using NonPtrType = std::remove_pointer_t<NonArrayType>; using UndecoratedType = std::remove_cv_t <NonPtrType>; //handle "const char* const" @@ -107,9 +111,9 @@ class StringTraits public: enum { - isStringClass = HasMemberType_value_type<CleanType>::value && - HasMember_c_str <CleanType>::value && - HasMember_length <CleanType>::value + isStringClass = HasMemberTypeV_value_type<CleanType>&& + HasMemberV_c_str <CleanType>&& + HasMemberV_length <CleanType> }; using CharType = typename GetCharTypeImpl<UndecoratedType, isStringClass>::Type; |