Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
59fee54f
Commit
59fee54f
authored
Jul 31, 2014
by
Philipp A. Hartmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GenericValue::Erase: pass ConstValueIterators
parent
9a9c6d68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
document.h
include/rapidjson/document.h
+6
-5
No files found.
include/rapidjson/document.h
View file @
59fee54f
...
@@ -1011,7 +1011,7 @@ int z = a[0u].GetInt(); // This works too.
...
@@ -1011,7 +1011,7 @@ int z = a[0u].GetInt(); // This works too.
\pre IsArray() == true && \ref Begin() <= \c pos < \ref End()
\pre IsArray() == true && \ref Begin() <= \c pos < \ref End()
\return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned.
\return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned.
*/
*/
ValueIterator
Erase
(
ValueIterator
pos
)
{
ValueIterator
Erase
(
Const
ValueIterator
pos
)
{
return
Erase
(
pos
,
pos
+
1
);
return
Erase
(
pos
,
pos
+
1
);
}
}
...
@@ -1022,18 +1022,19 @@ int z = a[0u].GetInt(); // This works too.
...
@@ -1022,18 +1022,19 @@ int z = a[0u].GetInt(); // This works too.
\pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End()
\pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End()
\return Iterator following the last removed element.
\return Iterator following the last removed element.
*/
*/
ValueIterator
Erase
(
ValueIterator
first
,
ValueIterator
last
)
{
ValueIterator
Erase
(
ConstValueIterator
first
,
Const
ValueIterator
last
)
{
RAPIDJSON_ASSERT
(
IsArray
());
RAPIDJSON_ASSERT
(
IsArray
());
RAPIDJSON_ASSERT
(
data_
.
a
.
size
>
0
);
RAPIDJSON_ASSERT
(
data_
.
a
.
size
>
0
);
RAPIDJSON_ASSERT
(
data_
.
a
.
elements
!=
0
);
RAPIDJSON_ASSERT
(
data_
.
a
.
elements
!=
0
);
RAPIDJSON_ASSERT
(
first
>=
Begin
());
RAPIDJSON_ASSERT
(
first
>=
Begin
());
RAPIDJSON_ASSERT
(
first
<=
last
);
RAPIDJSON_ASSERT
(
first
<=
last
);
RAPIDJSON_ASSERT
(
last
<=
End
());
RAPIDJSON_ASSERT
(
last
<=
End
());
for
(
ValueIterator
itr
=
first
;
itr
!=
last
;
++
itr
)
ValueIterator
pos
=
Begin
()
+
(
first
-
Begin
());
for
(
ValueIterator
itr
=
pos
;
itr
!=
last
;
++
itr
)
itr
->~
GenericValue
();
itr
->~
GenericValue
();
memmove
(
first
,
last
,
(
End
()
-
last
)
*
sizeof
(
GenericValue
));
memmove
(
pos
,
last
,
(
End
()
-
last
)
*
sizeof
(
GenericValue
));
data_
.
a
.
size
-=
(
last
-
first
);
data_
.
a
.
size
-=
(
last
-
first
);
return
first
;
return
pos
;
}
}
//@}
//@}
...
...
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