Allow disabling default enum conversions (#3536)
This commit is contained in:
1 parent
e80945da2c
commit
f6acdbec2c
14 files changed
+172
-2
No files matched your search
@@ -313,6 +313,7 @@ inline void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept
|
||||
external_constructor<value_t::number_integer>::construct(j, static_cast<typename BasicJsonType::number_integer_t>(val));
|
||||
}
|
||||
|
||||
#if !JSON_DISABLE_ENUM_SERIALIZATION
|
||||
template<typename BasicJsonType, typename EnumType,
|
||||
enable_if_t<std::is_enum<EnumType>::value, int> = 0>
|
||||
inline void to_json(BasicJsonType& j, EnumType e) noexcept
|
||||
@@ -320,6 +321,7 @@ inline void to_json(BasicJsonType& j, EnumType e) noexcept
|
||||
using underlying_type = typename std::underlying_type<EnumType>::type;
|
||||
external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
|
||||
}
|
||||
#endif // JSON_DISABLE_ENUM_SERIALIZATION
|
||||
|
||||
template<typename BasicJsonType>
|
||||
inline void to_json(BasicJsonType& j, const std::vector<bool>& e)
|
||||
|
||||
Reference in new issue
Block a user