Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
0fc261f0
Commit
0fc261f0
authored
Jul 03, 2020
by
Agustín F. Pozuelo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ordered_map compatible with GCC 5.5
parent
49f26a02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
ordered_map.hpp
include/nlohmann/ordered_map.hpp
+11
-5
json.hpp
single_include/nlohmann/json.hpp
+12
-6
No files found.
include/nlohmann/ordered_map.hpp
View file @
0fc261f0
...
@@ -11,16 +11,22 @@ namespace nlohmann
...
@@ -11,16 +11,22 @@ namespace nlohmann
/// ordered_map: a minimal map-like container that preserves insertion order
/// ordered_map: a minimal map-like container that preserves insertion order
/// for use within nlohmann::basic_json<ordered_map>
/// for use within nlohmann::basic_json<ordered_map>
template
<
class
Key
,
class
T
,
class
IgnoredLess
=
std
::
less
<
Key
>
,
template
<
class
Key
,
class
T
,
class
IgnoredLess
=
std
::
less
<
Key
>
,
class
Allocator
=
std
::
allocator
<
std
::
pair
<
const
Key
,
T
>>>
class
Allocator
=
std
::
allocator
<
std
::
pair
<
const
Key
,
T
>>
,
struct
ordered_map
:
std
::
vector
<
typename
Allocator
::
value_type
,
Allocator
>
class
Container
=
std
::
vector
<
std
::
pair
<
const
Key
,
T
>
,
Allocator
>>
struct
ordered_map
:
Container
{
{
using
Container
=
std
::
vector
<
typename
Allocator
::
value_type
,
Allocator
>
;
using
key_type
=
Key
;
using
key_type
=
Key
;
using
mapped_type
=
T
;
using
mapped_type
=
T
;
using
typename
Container
::
iterator
;
using
typename
Container
::
iterator
;
using
typename
Container
::
value_type
;
using
typename
Container
::
size_type
;
using
typename
Container
::
size_type
;
using
Container
::
Container
;
using
typename
Container
::
value_type
;
// Explicit constructors instead of `using Container::Container`
// otherwise older compilers like GCC 5.5 choke on it
ordered_map
(
const
Allocator
&
alloc
=
Allocator
())
:
Container
{
alloc
}
{}
template
<
class
It
>
ordered_map
(
It
first
,
It
last
,
const
Allocator
&
alloc
=
Allocator
())
:
Container
{
first
,
last
,
alloc
}
{}
std
::
pair
<
iterator
,
bool
>
emplace
(
key_type
&&
key
,
T
&&
t
)
std
::
pair
<
iterator
,
bool
>
emplace
(
key_type
&&
key
,
T
&&
t
)
{
{
...
...
single_include/nlohmann/json.hpp
View file @
0fc261f0
...
@@ -2773,7 +2773,7 @@ uses the standard template types.
...
@@ -2773,7 +2773,7 @@ uses the standard template types.
*/
*/
using
json
=
basic_json
<>
;
using
json
=
basic_json
<>
;
template
<
class
Key
,
class
T
,
class
IgnoredLess
,
class
Allocator
>
template
<
class
Key
,
class
T
,
class
IgnoredLess
,
class
Allocator
,
class
Container
>
struct
ordered_map
;
struct
ordered_map
;
/*!
/*!
...
@@ -15880,16 +15880,22 @@ namespace nlohmann
...
@@ -15880,16 +15880,22 @@ namespace nlohmann
/// ordered_map: a minimal map-like container that preserves insertion order
/// ordered_map: a minimal map-like container that preserves insertion order
/// for use within nlohmann::basic_json<ordered_map>
/// for use within nlohmann::basic_json<ordered_map>
template
<
class
Key
,
class
T
,
class
IgnoredLess
=
std
::
less
<
Key
>
,
template
<
class
Key
,
class
T
,
class
IgnoredLess
=
std
::
less
<
Key
>
,
class
Allocator
=
std
::
allocator
<
std
::
pair
<
const
Key
,
T
>>>
class
Allocator
=
std
::
allocator
<
std
::
pair
<
const
Key
,
T
>>
,
struct
ordered_map
:
std
::
vector
<
typename
Allocator
::
value_type
,
Allocator
>
class
Container
=
std
::
vector
<
std
::
pair
<
const
Key
,
T
>
,
Allocator
>>
struct
ordered_map
:
Container
{
{
using
Container
=
std
::
vector
<
typename
Allocator
::
value_type
,
Allocator
>
;
using
key_type
=
Key
;
using
key_type
=
Key
;
using
mapped_type
=
T
;
using
mapped_type
=
T
;
using
typename
Container
::
iterator
;
using
typename
Container
::
iterator
;
using
typename
Container
::
value_type
;
using
typename
Container
::
size_type
;
using
typename
Container
::
size_type
;
using
Container
::
Container
;
using
typename
Container
::
value_type
;
// Explicit constructors instead of `using Container::Container`
// otherwise older compilers like GCC 5.5 choke on it
ordered_map
(
const
Allocator
&
alloc
=
Allocator
())
:
Container
{
alloc
}
{}
template
<
class
It
>
ordered_map
(
It
first
,
It
last
,
const
Allocator
&
alloc
=
Allocator
())
:
Container
{
first
,
last
,
alloc
}
{}
std
::
pair
<
iterator
,
bool
>
emplace
(
key_type
&&
key
,
T
&&
t
)
std
::
pair
<
iterator
,
bool
>
emplace
(
key_type
&&
key
,
T
&&
t
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment