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
6f0053a2
Commit
6f0053a2
authored
Apr 16, 2016
by
Niels
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'support-move-iterators' of
https://github.com/robertmrk/json
into develop
parents
507322e6
2197f5f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
src/json.hpp
src/json.hpp
+2
-2
src/json.hpp.re2c
src/json.hpp.re2c
+2
-2
test/unit.cpp
test/unit.cpp
+11
-0
No files found.
src/json.hpp
View file @
6f0053a2
...
@@ -7000,13 +7000,13 @@ class basic_json
...
@@ -7000,13 +7000,13 @@ class basic_json
}
}
/// return a reference to the value pointed to by the iterator
/// return a reference to the value pointed to by the iterator
reference
operator
*
()
reference
operator
*
()
const
{
{
return
const_cast
<
reference
>
(
base_iterator
::
operator
*
());
return
const_cast
<
reference
>
(
base_iterator
::
operator
*
());
}
}
/// dereference the iterator
/// dereference the iterator
pointer
operator
->
()
pointer
operator
->
()
const
{
{
return
const_cast
<
pointer
>
(
base_iterator
::
operator
->
());
return
const_cast
<
pointer
>
(
base_iterator
::
operator
->
());
}
}
...
...
src/json.hpp.re2c
View file @
6f0053a2
...
@@ -7000,13 +7000,13 @@ class basic_json
...
@@ -7000,13 +7000,13 @@ class basic_json
}
}
/// return a reference to the value pointed to by the iterator
/// return a reference to the value pointed to by the iterator
reference operator*()
reference operator*()
const
{
{
return const_cast<reference>(base_iterator::operator*());
return const_cast<reference>(base_iterator::operator*());
}
}
/// dereference the iterator
/// dereference the iterator
pointer operator->()
pointer operator->()
const
{
{
return const_cast<pointer>(base_iterator::operator->());
return const_cast<pointer>(base_iterator::operator->());
}
}
...
...
test/unit.cpp
View file @
6f0053a2
...
@@ -12407,5 +12407,16 @@ TEST_CASE("regression tests")
...
@@ -12407,5 +12407,16 @@ TEST_CASE("regression tests")
CHECK
(
j3b
.
dump
()
==
"1E04"
);
CHECK
(
j3b
.
dump
()
==
"1E04"
);
CHECK
(
j3c
.
dump
()
==
"1e04"
);
CHECK
(
j3c
.
dump
()
==
"1e04"
);
}
}
SECTION
(
"issue #233 - Can't use basic_json::iterator as a base iterator for std::move_iterator"
)
{
json
source
=
{
"a"
,
"b"
,
"c"
};
json
expected
=
{
"a"
,
"b"
};
json
dest
;
std
::
copy_n
(
std
::
make_move_iterator
(
source
.
begin
()),
2
,
std
::
back_inserter
(
dest
));
CHECK
(
dest
==
expected
);
}
}
}
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