diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2018-06-30 12:43:08 +0200 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2018-06-30 12:43:08 +0200 |
commit | a98326eb2954ac1e79f5eac28dbeab3ec15e047f (patch) | |
tree | bb16257a1894b488e365851273735ec13a9442ef /zenXml/zenxml/cvrt_struc.h | |
parent | 10.0 (diff) | |
download | FreeFileSync-a98326eb2954ac1e79f5eac28dbeab3ec15e047f.tar.gz FreeFileSync-a98326eb2954ac1e79f5eac28dbeab3ec15e047f.tar.bz2 FreeFileSync-a98326eb2954ac1e79f5eac28dbeab3ec15e047f.zip |
10.1
Diffstat (limited to 'zenXml/zenxml/cvrt_struc.h')
-rwxr-xr-x | zenXml/zenxml/cvrt_struc.h | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/zenXml/zenxml/cvrt_struc.h b/zenXml/zenxml/cvrt_struc.h index 3a18ea73..11795107 100755 --- a/zenXml/zenxml/cvrt_struc.h +++ b/zenXml/zenxml/cvrt_struc.h @@ -56,14 +56,13 @@ ZEN_INIT_DETECT_MEMBER(insert) // } template <typename T> -struct IsStlContainer : - StaticBool< - impl_2384343::HasMemberType_value_type <T>::value&& - impl_2384343::HasMemberType_iterator <T>::value&& - impl_2384343::HasMemberType_const_iterator<T>::value&& - impl_2384343::HasMember_begin <T>::value&& - impl_2384343::HasMember_end <T>::value&& - impl_2384343::HasMember_insert <T>::value> {}; +using IsStlContainer = std::bool_constant< + impl_2384343::HasMemberType_value_type <T>::value && + impl_2384343::HasMemberType_iterator <T>::value && + impl_2384343::HasMemberType_const_iterator<T>::value && + impl_2384343::HasMember_begin <T>::value && + impl_2384343::HasMember_end <T>::value && + impl_2384343::HasMember_insert <T>::value>; namespace impl_2384343 @@ -76,29 +75,28 @@ ZEN_INIT_DETECT_MEMBER(second) // } template <typename T> -struct IsStlPair : - StaticBool< - impl_2384343::HasMemberType_first_type <T>::value&& - impl_2384343::HasMemberType_second_type<T>::value&& - impl_2384343::HasMember_first <T>::value&& - impl_2384343::HasMember_second <T>::value> {}; +using IsStlPair = std::bool_constant< + impl_2384343::HasMemberType_first_type <T>::value && + impl_2384343::HasMemberType_second_type<T>::value && + impl_2384343::HasMember_first <T>::value && + impl_2384343::HasMember_second <T>::value>; //###################################################################################### //Conversion from arbitrary types to an XML element -enum ValueType +enum class ValueType { - VALUE_TYPE_STL_CONTAINER, - VALUE_TYPE_STL_PAIR, - VALUE_TYPE_OTHER, + STL_CONTAINER, + STL_PAIR, + OTHER, }; template <class T> -struct GetValueType : StaticEnum<ValueType, - GetTextType<T>::value != TEXT_TYPE_OTHER ? VALUE_TYPE_OTHER : //some string classes are also STL containers, so check this first - IsStlContainer<T>::value ? VALUE_TYPE_STL_CONTAINER : - IsStlPair<T>::value ? VALUE_TYPE_STL_PAIR : - VALUE_TYPE_OTHER> {}; +using GetValueType = std::integral_constant<ValueType, + GetTextType <T>::value != TEXT_TYPE_OTHER ? ValueType::OTHER : //some string classes are also STL containers, so check this first + IsStlContainer<T>::value ? ValueType::STL_CONTAINER : + IsStlPair <T>::value ? ValueType::STL_PAIR : + ValueType::OTHER>; template <class T, ValueType type> @@ -113,7 +111,7 @@ struct ConvertElement; //partial specialization: handle conversion for all STL-container types! template <class T> -struct ConvertElement<T, VALUE_TYPE_STL_CONTAINER> +struct ConvertElement<T, ValueType::STL_CONTAINER> { void writeStruc(const T& value, XmlElement& output) const { @@ -145,7 +143,7 @@ struct ConvertElement<T, VALUE_TYPE_STL_CONTAINER> //partial specialization: handle conversion for std::pair template <class T> -struct ConvertElement<T, VALUE_TYPE_STL_PAIR> +struct ConvertElement<T, ValueType::STL_PAIR> { void writeStruc(const T& value, XmlElement& output) const { @@ -173,7 +171,7 @@ struct ConvertElement<T, VALUE_TYPE_STL_PAIR> //partial specialization: not a pure structured type, try text conversion (thereby respect user specializations of writeText()/readText()) template <class T> -struct ConvertElement<T, VALUE_TYPE_OTHER> +struct ConvertElement<T, ValueType::OTHER> { void writeStruc(const T& value, XmlElement& output) const { |