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
294fa343
Unverified
Commit
294fa343
authored
Jan 03, 2021
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
fix bug in move constructor
parent
ec0b1798
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
5 deletions
+57
-5
json.hpp
include/nlohmann/json.hpp
+28
-2
json.hpp
single_include/nlohmann/json.hpp
+28
-2
unit-json_patch.cpp
test/src/unit-json_patch.cpp
+1
-1
No files found.
include/nlohmann/json.hpp
View file @
294fa343
...
@@ -1873,9 +1873,9 @@ class basic_json
...
@@ -1873,9 +1873,9 @@ class basic_json
{
{
m_value
.
array
=
create
<
array_t
>
(
cnt
,
val
);
m_value
.
array
=
create
<
array_t
>
(
cnt
,
val
);
#if JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
for
(
auto
&
e
ntry
:
*
m_value
.
array
)
for
(
auto
&
e
lement
:
*
m_value
.
array
)
{
{
e
ntry
.
m_parent
=
this
;
e
lement
.
m_parent
=
this
;
}
}
#endif
#endif
assert_invariant
();
assert_invariant
();
...
@@ -2196,6 +2196,32 @@ class basic_json
...
@@ -2196,6 +2196,32 @@ class basic_json
other
.
m_type
=
value_t
::
null
;
other
.
m_type
=
value_t
::
null
;
other
.
m_value
=
{};
other
.
m_value
=
{};
#if JSON_DIAGNOSTICS
switch
(
m_type
)
{
case
value_t
:
:
array
:
{
for
(
auto
&
element
:
*
m_value
.
array
)
{
element
.
m_parent
=
this
;
}
break
;
}
case
value_t
:
:
object
:
{
for
(
auto
&
element
:
*
m_value
.
object
)
{
element
.
second
.
m_parent
=
this
;
}
break
;
}
default
:
break
;
}
#endif
assert_invariant
();
assert_invariant
();
}
}
...
...
single_include/nlohmann/json.hpp
View file @
294fa343
...
@@ -18509,9 +18509,9 @@ class basic_json
...
@@ -18509,9 +18509,9 @@ class basic_json
{
{
m_value
.
array
=
create
<
array_t
>
(
cnt
,
val
);
m_value
.
array
=
create
<
array_t
>
(
cnt
,
val
);
#if JSON_DIAGNOSTICS
#if JSON_DIAGNOSTICS
for
(
auto
&
e
ntry
:
*
m_value
.
array
)
for
(
auto
&
e
lement
:
*
m_value
.
array
)
{
{
e
ntry
.
m_parent
=
this
;
e
lement
.
m_parent
=
this
;
}
}
#endif
#endif
assert_invariant
();
assert_invariant
();
...
@@ -18832,6 +18832,32 @@ class basic_json
...
@@ -18832,6 +18832,32 @@ class basic_json
other
.
m_type
=
value_t
::
null
;
other
.
m_type
=
value_t
::
null
;
other
.
m_value
=
{};
other
.
m_value
=
{};
#if JSON_DIAGNOSTICS
switch
(
m_type
)
{
case
value_t
:
:
array
:
{
for
(
auto
&
element
:
*
m_value
.
array
)
{
element
.
m_parent
=
this
;
}
break
;
}
case
value_t
:
:
object
:
{
for
(
auto
&
element
:
*
m_value
.
object
)
{
element
.
second
.
m_parent
=
this
;
}
break
;
}
default
:
break
;
}
#endif
assert_invariant
();
assert_invariant
();
}
}
...
...
test/src/unit-json_patch.cpp
View file @
294fa343
...
@@ -1280,7 +1280,7 @@ TEST_CASE("JSON patch")
...
@@ -1280,7 +1280,7 @@ TEST_CASE("JSON patch")
std
::
ifstream
f
(
filename
);
std
::
ifstream
f
(
filename
);
json
suite
=
json
::
parse
(
f
);
json
suite
=
json
::
parse
(
f
);
for
(
const
auto
test
:
suite
)
for
(
const
auto
&
test
:
suite
)
{
{
INFO_WITH_TEMP
(
test
.
value
(
"comment"
,
""
));
INFO_WITH_TEMP
(
test
.
value
(
"comment"
,
""
));
...
...
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