Skip to content

Commit f26bec8

Browse files
committed
Add the amalgamated files
1 parent 56f1766 commit f26bec8

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

include/nlohmann/detail/conversions/from_json.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ inline void from_json(const BasicJsonType& j, typename BasicJsonType::binary_t&
325325
bin = *j.template get_ptr<const typename BasicJsonType::binary_t*>();
326326
}
327327

328-
template<typename BasicJsonType, typename ConstructibleObjectType,
329-
enable_if_t<is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value&&
330-
!std::is_enum<typename ConstructibleObjectType::key_type>::value, int> = 0>
328+
template < typename BasicJsonType, typename ConstructibleObjectType,
329+
enable_if_t < is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value&&
330+
!std::is_enum<typename ConstructibleObjectType::key_type>::value, int > = 0 >
331331
inline void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
332332
{
333333
if (JSON_HEDLEY_UNLIKELY(!j.is_object()))
@@ -348,10 +348,10 @@ inline void from_json(const BasicJsonType& j, ConstructibleObjectType& obj)
348348
obj = std::move(ret);
349349
}
350350

351-
template <typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
352-
enable_if_t<is_constructible_object_type<BasicJsonType, std::map<Key, Value, Compare, Allocator>>::value&&
353-
is_compatible_object_type<BasicJsonType, std::map<Key, Value, Compare, Allocator>>::value&&
354-
std::is_enum<Key>::value, int> = 0>
351+
template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
352+
enable_if_t < is_constructible_object_type<BasicJsonType, std::map<Key, Value, Compare, Allocator>>::value&&
353+
is_compatible_object_type<BasicJsonType, std::map<Key, Value, Compare, Allocator>>::value&&
354+
std::is_enum<Key>::value, int > = 0 >
355355
inline void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allocator>& m)
356356
{
357357
if (JSON_HEDLEY_UNLIKELY(!j.is_object()))
@@ -361,7 +361,7 @@ inline void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allo
361361
m.clear();
362362
for (const auto& p : j.items())
363363
{
364-
m.emplace(string_to_enum(json(p.key()),Key()), p.value().template get<Value>());
364+
m.emplace(string_to_enum(json(p.key()), Key()), p.value().template get<Value>());
365365
}
366366
}
367367

@@ -459,7 +459,7 @@ auto from_json(BasicJsonType&& j, TupleRelated&& t)
459459
template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
460460
typename = enable_if_t < !std::is_constructible <
461461
typename BasicJsonType::string_t, Key >::value &&
462-
!is_compatible_object_type<BasicJsonType, std::map<Key, Value, Compare, Allocator>>::value>>
462+
!is_compatible_object_type<BasicJsonType, std::map<Key, Value, Compare, Allocator>>::value >>
463463
inline void from_json(const BasicJsonType& j, std::map<Key, Value, Compare, Allocator>& m)
464464
{
465465
if (JSON_HEDLEY_UNLIKELY(!j.is_array()))

single_include/nlohmann/json.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5776,7 +5776,8 @@ struct external_constructor<value_t::object>
57765776

57775777
template < typename BasicJsonType, typename CompatibleObjectType,
57785778
enable_if_t < !std::is_same<CompatibleObjectType, typename BasicJsonType::object_t>::value&&
5779-
is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value&& !is_basic_json<CompatibleObjectType>::value&&
5779+
is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value&&
5780+
!is_basic_json<CompatibleObjectType>::value&&
57805781
!std::is_enum<typename CompatibleObjectType::key_type>::value, int > = 0 >
57815782
static void construct(BasicJsonType& j, const CompatibleObjectType& obj)
57825783
{
@@ -5915,16 +5916,17 @@ inline void to_json(BasicJsonType& j, typename BasicJsonType::array_t&& arr)
59155916
}
59165917

59175918
template < typename BasicJsonType, typename CompatibleObjectType,
5918-
enable_if_t < is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value&& !is_basic_json<CompatibleObjectType>::value&&
5919+
enable_if_t < is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value&&
5920+
!is_basic_json<CompatibleObjectType>::value&&
59195921
!std::is_enum<typename CompatibleObjectType::key_type>::value, int > = 0 >
59205922
inline void to_json(BasicJsonType& j, const CompatibleObjectType& obj)
59215923
{
59225924
external_constructor<value_t::object>::construct(j, obj);
59235925
}
59245926

59255927
template < typename BasicJsonType, typename Key, typename Value,
5926-
enable_if_t < (is_compatible_object_type<BasicJsonType, std::map<Key, Value>>::value)&&
5927-
(!is_basic_json<std::map<Key, Value>>::value)&&
5928+
enable_if_t < is_compatible_object_type<BasicJsonType, std::map<Key, Value>>::value&&
5929+
!is_basic_json<std::map<Key, Value>>::value&&
59285930
std::is_enum<Key>::value, int > = 0 >
59295931
inline void to_json(BasicJsonType& j, const std::map<Key, Value>& obj)
59305932
{

0 commit comments

Comments
 (0)