Skip to content

Commit

Permalink
Use std::map default allocator as a placeholder
Browse files Browse the repository at this point in the history
to extract the actual ObjectType::value_type
Still fails on older compilers (GCC <= 5.5)
  • Loading branch information
gatopeich committed Jun 23, 2020
1 parent 49623a7 commit acd748e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,12 @@ class basic_json
using object_t = ObjectType<StringType,
basic_json,
object_comparator_t,
// Note: instantiating ObjectType with dummy allocator to extract ::value_type
AllocatorType<typename ObjectType<StringType, basic_json, object_comparator_t, AllocatorType<int>
>::value_type>>;
// Note the use of std::map default allocator as a placeholder
// to extract the actual ObjectType::value_type
AllocatorType<typename
ObjectType<StringType,basic_json,object_comparator_t,
std::allocator<std::pair<const StringType, basic_json>>
>::value_type>>;

/*!
@brief a type for an array
Expand Down
9 changes: 6 additions & 3 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16348,9 +16348,12 @@ class basic_json
using object_t = ObjectType<StringType,
basic_json,
object_comparator_t,
// Note: instantiating ObjectType with dummy allocator to extract ::value_type
AllocatorType<typename ObjectType<StringType, basic_json, object_comparator_t, AllocatorType<int>
>::value_type>>;
// Note the use of std::map default allocator as a placeholder
// to extract the actual ObjectType::value_type
AllocatorType<typename
ObjectType<StringType,basic_json,object_comparator_t,
std::allocator<std::pair<const StringType, basic_json>>
>::value_type>>;

/*!
@brief a type for an array
Expand Down

0 comments on commit acd748e

Please sign in to comment.