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
6a656ed3
Commit
6a656ed3
authored
May 10, 2017
by
Jay Sistar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding first and second properties to iteration_proxy_internal
parent
2afbd334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
src/json.hpp
src/json.hpp
+42
-1
No files found.
src/json.hpp
View file @
6a656ed3
...
...
@@ -7877,6 +7877,44 @@ class basic_json
class
iteration_proxy
{
private:
/// helper class for first "property"
template
<
typename
ProxyType
>
class
iterator_key_property
{
private:
/// the reference to the proxy
ProxyType
&
proxy
;
public:
explicit
iterator_key_property
(
ProxyType
&
proxyRef
)
noexcept
:
proxy
(
proxyRef
)
{}
/// conversion operator (calls key())
operator
typename
basic_json
::
string_t
()
const
{
return
proxy
.
key
();
}
};
/// helper class for second "property"
template
<
typename
ProxyType
>
class
iterator_value_property
{
private:
/// the reference to the proxy
ProxyType
&
proxy
;
public:
explicit
iterator_value_property
(
ProxyType
&
proxyRef
)
noexcept
:
proxy
(
proxyRef
)
{}
/// conversion operator (calls value())
operator
typename
IteratorType
::
reference
()
const
{
return
proxy
.
value
();
}
};
/// helper class for iteration
class
iteration_proxy_internal
{
...
...
@@ -7887,8 +7925,11 @@ class basic_json
size_t
array_index
=
0
;
public:
iterator_key_property
<
iteration_proxy_internal
>
first
;
iterator_value_property
<
iteration_proxy_internal
>
second
;
explicit
iteration_proxy_internal
(
IteratorType
it
)
noexcept
:
anchor
(
it
)
:
anchor
(
it
)
,
first
(
*
this
),
second
(
*
this
)
{}
/// dereference operator (needed for range-based for)
...
...
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