Use uint64/int64 to serialize enums

Otherwise, enums using char as underlying types
can not not be serialized.
This commit is contained in:
Martchus 2017-12-22 20:30:55 +01:00
parent 9a2c2cfef6
commit 29b39bc7bc
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_
template <typename Type, Traits::EnableIfAny<std::is_enum<Type>>...>
inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator)
{
value.Set(static_cast<typename std::underlying_type<Type>::type>(reflectable), allocator);
value.Set(static_cast<Traits::Conditional<std::is_unsigned<typename std::underlying_type<Type>::type>, uint64, int64>>(reflectable), allocator);
}
/*!