Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
09cd4ed1
Unverified
Commit
09cd4ed1
authored
4 years ago
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix preprocessor check
parent
c6e7fa21
develop
bon8
coverity_scan
gcc_warning_flags
icpc
issue2932
issue3232_use_catch
master
release/3.10.2
release/3.10.3
release/3.10.4
release/3.10.5
string_view
string_view2
update_doctest
v3.10.5
v3.10.4
v3.10.3
v3.10.2
v3.10.1
v3.10.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+16
-16
No files found.
single_include/nlohmann/json.hpp
View file @
09cd4ed1
...
@@ -18266,7 +18266,7 @@ class basic_json
...
@@ -18266,7 +18266,7 @@ class basic_json
std
::
for_each
(
init
.
begin
(),
init
.
end
(),
[
this
](
const
detail
::
json_ref
<
basic_json
>&
element_ref
)
std
::
for_each
(
init
.
begin
(),
init
.
end
(),
[
this
](
const
detail
::
json_ref
<
basic_json
>&
element_ref
)
{
{
auto
element
=
element_ref
.
moved_or_copied
();
auto
element
=
element_ref
.
moved_or_copied
();
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
(
*
element
.
m_value
.
array
)[
1
].
m_parent
=
this
;
(
*
element
.
m_value
.
array
)[
1
].
m_parent
=
this
;
#endif
#endif
m_value
.
object
->
emplace
(
m_value
.
object
->
emplace
(
...
@@ -18279,7 +18279,7 @@ class basic_json
...
@@ -18279,7 +18279,7 @@ class basic_json
// the initializer list describes an array -> create array
// the initializer list describes an array -> create array
m_type
=
value_t
::
array
;
m_type
=
value_t
::
array
;
m_value
.
array
=
create
<
array_t
>
(
init
.
begin
(),
init
.
end
());
m_value
.
array
=
create
<
array_t
>
(
init
.
begin
(),
init
.
end
());
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
for
(
auto
&
element
:
*
m_value
.
array
)
for
(
auto
&
element
:
*
m_value
.
array
)
{
{
element
.
m_parent
=
this
;
element
.
m_parent
=
this
;
...
@@ -18779,7 +18779,7 @@ class basic_json
...
@@ -18779,7 +18779,7 @@ class basic_json
basic_json
(
basic_json
&&
other
)
noexcept
basic_json
(
basic_json
&&
other
)
noexcept
:
m_type
(
std
::
move
(
other
.
m_type
)),
:
m_type
(
std
::
move
(
other
.
m_type
)),
m_value
(
std
::
move
(
other
.
m_value
))
m_value
(
std
::
move
(
other
.
m_value
))
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
,
m_parent
(
other
.
m_parent
)
,
m_parent
(
other
.
m_parent
)
#endif
#endif
{
{
...
@@ -19333,7 +19333,7 @@ class basic_json
...
@@ -19333,7 +19333,7 @@ class basic_json
std
::
string
diagnostics
()
const
std
::
string
diagnostics
()
const
{
{
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
std
::
vector
<
std
::
string
>
tokens
;
std
::
vector
<
std
::
string
>
tokens
;
for
(
const
basic_json
*
current
=
this
;
current
->
m_parent
!=
nullptr
;
current
=
current
->
m_parent
)
for
(
const
basic_json
*
current
=
this
;
current
->
m_parent
!=
nullptr
;
current
=
current
->
m_parent
)
{
{
...
@@ -20008,7 +20008,7 @@ class basic_json
...
@@ -20008,7 +20008,7 @@ class basic_json
{
{
JSON_TRY
JSON_TRY
{
{
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
reference
result
=
m_value
.
array
->
at
(
idx
);
reference
result
=
m_value
.
array
->
at
(
idx
);
result
.
m_parent
=
this
;
result
.
m_parent
=
this
;
return
result
;
return
result
;
...
@@ -20112,7 +20112,7 @@ class basic_json
...
@@ -20112,7 +20112,7 @@ class basic_json
{
{
JSON_TRY
JSON_TRY
{
{
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
reference
result
=
m_value
.
object
->
at
(
key
);
reference
result
=
m_value
.
object
->
at
(
key
);
result
.
m_parent
=
this
;
result
.
m_parent
=
this
;
return
result
;
return
result
;
...
@@ -20227,12 +20227,12 @@ class basic_json
...
@@ -20227,12 +20227,12 @@ class basic_json
m_value
.
array
->
insert
(
m_value
.
array
->
end
(),
m_value
.
array
->
insert
(
m_value
.
array
->
end
(),
idx
-
m_value
.
array
->
size
()
+
1
,
idx
-
m_value
.
array
->
size
()
+
1
,
basic_json
());
basic_json
());
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
m_value
.
array
->
back
().
m_parent
=
this
;
m_value
.
array
->
back
().
m_parent
=
this
;
#endif
#endif
}
}
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
reference
result
=
m_value
.
array
->
operator
[](
idx
);
reference
result
=
m_value
.
array
->
operator
[](
idx
);
result
.
m_parent
=
this
;
result
.
m_parent
=
this
;
return
result
;
return
result
;
...
@@ -20314,7 +20314,7 @@ class basic_json
...
@@ -20314,7 +20314,7 @@ class basic_json
// operator[] only works for objects
// operator[] only works for objects
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
{
{
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
reference
result
=
m_value
.
object
->
operator
[](
key
);
reference
result
=
m_value
.
object
->
operator
[](
key
);
result
.
m_parent
=
this
;
result
.
m_parent
=
this
;
return
result
;
return
result
;
...
@@ -20410,7 +20410,7 @@ class basic_json
...
@@ -20410,7 +20410,7 @@ class basic_json
// at only works for objects
// at only works for objects
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
if
(
JSON_HEDLEY_LIKELY
(
is_object
()))
{
{
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
reference
result
=
m_value
.
object
->
operator
[](
key
);
reference
result
=
m_value
.
object
->
operator
[](
key
);
result
.
m_parent
=
this
;
result
.
m_parent
=
this
;
return
result
;
return
result
;
...
@@ -21972,7 +21972,7 @@ class basic_json
...
@@ -21972,7 +21972,7 @@ class basic_json
// add element to array (move semantics)
// add element to array (move semantics)
m_value
.
array
->
push_back
(
std
::
move
(
val
));
m_value
.
array
->
push_back
(
std
::
move
(
val
));
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
m_value
.
array
->
back
().
m_parent
=
this
;
m_value
.
array
->
back
().
m_parent
=
this
;
#endif
#endif
// if val is moved from, basic_json move constructor marks it null so we do not call the destructor
// if val is moved from, basic_json move constructor marks it null so we do not call the destructor
...
@@ -22010,7 +22010,7 @@ class basic_json
...
@@ -22010,7 +22010,7 @@ class basic_json
// add element to array
// add element to array
m_value
.
array
->
push_back
(
val
);
m_value
.
array
->
push_back
(
val
);
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
m_value
.
array
->
back
().
m_parent
=
this
;
m_value
.
array
->
back
().
m_parent
=
this
;
#endif
#endif
}
}
...
@@ -22062,7 +22062,7 @@ class basic_json
...
@@ -22062,7 +22062,7 @@ class basic_json
}
}
// add element to object
// add element to object
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
auto
res
=
m_value
.
object
->
insert
(
val
);
auto
res
=
m_value
.
object
->
insert
(
val
);
res
.
first
->
second
.
m_parent
=
this
;
res
.
first
->
second
.
m_parent
=
this
;
#else
#else
...
@@ -22171,7 +22171,7 @@ class basic_json
...
@@ -22171,7 +22171,7 @@ class basic_json
// add element to array (perfect forwarding)
// add element to array (perfect forwarding)
#ifdef JSON_HAS_CPP_17
#ifdef JSON_HAS_CPP_17
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
reference
result
=
m_value
.
array
->
emplace_back
(
std
::
forward
<
Args
>
(
args
)...);
reference
result
=
m_value
.
array
->
emplace_back
(
std
::
forward
<
Args
>
(
args
)...);
result
.
m_parent
=
this
;
result
.
m_parent
=
this
;
return
result
;
return
result
;
...
@@ -22180,7 +22180,7 @@ class basic_json
...
@@ -22180,7 +22180,7 @@ class basic_json
#endif
#endif
#else
#else
m_value
.
array
->
emplace_back
(
std
::
forward
<
Args
>
(
args
)...);
m_value
.
array
->
emplace_back
(
std
::
forward
<
Args
>
(
args
)...);
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
m_value
.
array
->
back
().
m_parent
=
this
;
m_value
.
array
->
back
().
m_parent
=
this
;
#endif
#endif
return
m_value
.
array
->
back
();
return
m_value
.
array
->
back
();
...
@@ -23710,7 +23710,7 @@ class basic_json
...
@@ -23710,7 +23710,7 @@ class basic_json
/// the value of the current element
/// the value of the current element
json_value
m_value
=
{};
json_value
m_value
=
{};
#if
def
JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
/// a pointer to a parent value (for debugging purposes)
/// a pointer to a parent value (for debugging purposes)
basic_json
*
m_parent
=
nullptr
;
basic_json
*
m_parent
=
nullptr
;
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
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