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
8b88e1b2
Commit
8b88e1b2
authored
May 13, 2017
by
Niels Lohmann
Committed by
GitHub
May 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #579 from Type1J/develop_feature_first_second
Fixing assignement for iterator wrapper second, and adding unit test
parents
5beea354
b78457b7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
json.hpp
src/json.hpp
+36
-0
CMakeLists.txt
test/CMakeLists.txt
+1
-0
unit-iterator_wrapper_first_second.cpp
test/src/unit-iterator_wrapper_first_second.cpp
+0
-0
No files found.
src/json.hpp
View file @
8b88e1b2
...
...
@@ -7894,6 +7894,20 @@ class basic_json
{
return
proxy
.
key
();
}
/// equal operator (calls key())
template
<
typename
KeyType
>
bool
operator
==
(
const
KeyType
&
key
)
const
{
return
proxy
.
key
()
==
key
;
}
/// not equal operator (calls key())
template
<
typename
KeyType
>
bool
operator
!=
(
const
KeyType
&
key
)
const
{
return
proxy
.
key
()
!=
key
;
}
};
/// helper class for second "property"
...
...
@@ -7913,6 +7927,28 @@ class basic_json
{
return
proxy
.
value
();
}
/// equal operator (calls value())
template
<
typename
ValueType
>
bool
operator
==
(
const
ValueType
&
value
)
const
{
return
proxy
.
value
()
==
value
;
}
/// not equal operator (calls value())
template
<
typename
ValueType
>
bool
operator
!=
(
const
ValueType
&
value
)
const
{
return
proxy
.
value
()
!=
value
;
}
/// assignment operator (calls value())
template
<
typename
ValueType
>
iterator_value_property
<
ProxyType
>&
operator
=
(
const
ValueType
&
value
)
{
proxy
.
value
()
=
value
;
return
*
this
;
}
};
/// helper class for iteration
...
...
test/CMakeLists.txt
View file @
8b88e1b2
...
...
@@ -30,6 +30,7 @@ add_executable(${JSON_UNITTEST_TARGET_NAME}
"src/unit-element_access2.cpp"
"src/unit-inspection.cpp"
"src/unit-iterator_wrapper.cpp"
"src/unit-iterator_wrapper_first_second.cpp"
"src/unit-iterators1.cpp"
"src/unit-iterators2.cpp"
"src/unit-json_patch.cpp"
...
...
test/src/unit-iterator_wrapper_first_second.cpp
0 → 100644
View file @
8b88e1b2
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