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
385865c4
Commit
385865c4
authored
Jan 31, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove checks in iterator
parent
9dff05d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
78 deletions
+2
-78
json.hpp
src/json.hpp
+2
-78
No files found.
src/json.hpp
View file @
385865c4
...
@@ -1514,11 +1514,6 @@ class basic_json
...
@@ -1514,11 +1514,6 @@ class basic_json
/// constructor for a given JSON instance
/// constructor for a given JSON instance
inline
iterator
(
pointer
object
)
:
m_object
(
object
)
inline
iterator
(
pointer
object
)
:
m_object
(
object
)
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
logic_error
(
"cannot create iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1606,11 +1601,6 @@ class basic_json
...
@@ -1606,11 +1601,6 @@ 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
inline
reference
operator
*
()
const
inline
reference
operator
*
()
const
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot get value"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1645,11 +1635,6 @@ class basic_json
...
@@ -1645,11 +1635,6 @@ class basic_json
/// dereference the iterator
/// dereference the iterator
inline
pointer
operator
->
()
const
inline
pointer
operator
->
()
const
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot get value"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1681,11 +1666,6 @@ class basic_json
...
@@ -1681,11 +1666,6 @@ class basic_json
{
{
iterator
result
=
*
this
;
iterator
result
=
*
this
;
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot increment iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1713,11 +1693,6 @@ class basic_json
...
@@ -1713,11 +1693,6 @@ class basic_json
/// pre-increment (++it)
/// pre-increment (++it)
inline
iterator
&
operator
++
()
inline
iterator
&
operator
++
()
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot increment iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1747,11 +1722,6 @@ class basic_json
...
@@ -1747,11 +1722,6 @@ class basic_json
{
{
iterator
result
=
*
this
;
iterator
result
=
*
this
;
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot decrement iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1779,11 +1749,6 @@ class basic_json
...
@@ -1779,11 +1749,6 @@ class basic_json
/// pre-decrement (--it)
/// pre-decrement (--it)
inline
iterator
&
operator
--
()
inline
iterator
&
operator
--
()
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot decrement iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1811,10 +1776,7 @@ class basic_json
...
@@ -1811,10 +1776,7 @@ class basic_json
/// comparison: equal
/// comparison: equal
inline
bool
operator
==
(
const
iterator
&
other
)
const
inline
bool
operator
==
(
const
iterator
&
other
)
const
{
{
if
(
m_object
==
nullptr
if
(
m_object
!=
other
.
m_object
or
m_object
->
m_type
!=
other
.
m_object
->
m_type
)
or
other
.
m_object
==
nullptr
or
m_object
!=
other
.
m_object
or
m_object
->
m_type
!=
other
.
m_object
->
m_type
)
{
{
return
false
;
return
false
;
}
}
...
@@ -1900,11 +1862,6 @@ class basic_json
...
@@ -1900,11 +1862,6 @@ class basic_json
/// constructor for a given JSON instance
/// constructor for a given JSON instance
inline
const_iterator
(
pointer
object
)
:
m_object
(
object
)
inline
const_iterator
(
pointer
object
)
:
m_object
(
object
)
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
logic_error
(
"cannot create iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -1995,11 +1952,6 @@ class basic_json
...
@@ -1995,11 +1952,6 @@ 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
inline
reference
operator
*
()
const
inline
reference
operator
*
()
const
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot get value"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -2034,11 +1986,6 @@ class basic_json
...
@@ -2034,11 +1986,6 @@ class basic_json
/// dereference the iterator
/// dereference the iterator
inline
pointer
operator
->
()
const
inline
pointer
operator
->
()
const
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot get value"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -2070,11 +2017,6 @@ class basic_json
...
@@ -2070,11 +2017,6 @@ class basic_json
{
{
const_iterator
result
=
*
this
;
const_iterator
result
=
*
this
;
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot increment iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -2102,11 +2044,6 @@ class basic_json
...
@@ -2102,11 +2044,6 @@ class basic_json
/// pre-increment (++it)
/// pre-increment (++it)
inline
const_iterator
&
operator
++
()
inline
const_iterator
&
operator
++
()
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot increment iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -2136,11 +2073,6 @@ class basic_json
...
@@ -2136,11 +2073,6 @@ class basic_json
{
{
iterator
result
=
*
this
;
iterator
result
=
*
this
;
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot decrement iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -2168,11 +2100,6 @@ class basic_json
...
@@ -2168,11 +2100,6 @@ class basic_json
/// pre-decrement (--it)
/// pre-decrement (--it)
inline
const_iterator
&
operator
--
()
inline
const_iterator
&
operator
--
()
{
{
if
(
m_object
==
nullptr
)
{
throw
std
::
out_of_range
(
"cannot decrement iterator"
);
}
switch
(
m_object
->
m_type
)
switch
(
m_object
->
m_type
)
{
{
case
(
basic_json
:
:
value_t
::
object
)
:
case
(
basic_json
:
:
value_t
::
object
)
:
...
@@ -2200,10 +2127,7 @@ class basic_json
...
@@ -2200,10 +2127,7 @@ class basic_json
/// comparison: equal
/// comparison: equal
inline
bool
operator
==
(
const
const_iterator
&
other
)
const
inline
bool
operator
==
(
const
const_iterator
&
other
)
const
{
{
if
(
m_object
==
nullptr
if
(
m_object
!=
other
.
m_object
or
m_object
->
m_type
!=
other
.
m_object
->
m_type
)
or
other
.
m_object
==
nullptr
or
m_object
!=
other
.
m_object
or
m_object
->
m_type
!=
other
.
m_object
->
m_type
)
{
{
return
false
;
return
false
;
}
}
...
...
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