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
d1e13d51
Unverified
Commit
d1e13d51
authored
Aug 02, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎉
first draft for #661
parent
0ea0d7d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
json.hpp
src/json.hpp
+25
-0
No files found.
src/json.hpp
View file @
d1e13d51
...
@@ -12066,6 +12066,31 @@ class basic_json
...
@@ -12066,6 +12066,31 @@ class basic_json
m_value
.
object
->
insert
(
first
.
m_it
.
object_iterator
,
last
.
m_it
.
object_iterator
);
m_value
.
object
->
insert
(
first
.
m_it
.
object_iterator
,
last
.
m_it
.
object_iterator
);
}
}
void
update
(
const_reference
j
)
{
// implicitly convert null value to an empty object
if
(
is_null
())
{
m_type
=
value_t
::
object
;
m_value
.
object
=
create
<
object_t
>
();
assert_invariant
();
}
if
(
JSON_UNLIKELY
(
not
is_object
()))
{
JSON_THROW
(
type_error
::
create
(
305
,
"cannot use merge with "
+
type_name
()));
}
if
(
JSON_UNLIKELY
(
not
j
.
is_object
()))
{
JSON_THROW
(
type_error
::
create
(
305
,
"cannot use merge with "
+
j
.
type_name
()));
}
for
(
auto
it
=
j
.
begin
();
it
!=
j
.
end
();
++
it
)
{
m_value
.
object
->
emplace
(
it
.
key
(),
it
.
value
());
}
}
/*!
/*!
@brief exchanges the values
@brief exchanges the values
...
...
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