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
fdd7a763
Commit
fdd7a763
authored
Aug 30, 2014
by
Philipp A. Hartmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GenericValue: use IsBaseOf to support comparisons between Value/Document
This finally fixes #113.
parent
f076faca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
document.h
include/rapidjson/document.h
+4
-4
No files found.
include/rapidjson/document.h
View file @
fdd7a763
...
...
@@ -683,7 +683,7 @@ public:
//! Equal-to operator with primitive types
/*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false
*/
template
<
typename
T
>
RAPIDJSON_DISABLEIF_RETURN
((
internal
::
IsPointer
<
T
>
),
(
bool
))
operator
==
(
const
T
&
rhs
)
const
{
return
*
this
==
GenericValue
(
rhs
);
}
template
<
typename
T
>
RAPIDJSON_DISABLEIF_RETURN
((
internal
::
OrExpr
<
internal
::
IsPointer
<
T
>
,
internal
::
IsBaseOf
<
GenericValue
,
T
>
>
),
(
bool
))
operator
==
(
const
T
&
rhs
)
const
{
return
*
this
==
GenericValue
(
rhs
);
}
//! Not-equal-to operator
/*! \return !(*this == rhs)
...
...
@@ -693,17 +693,17 @@ public:
//! Not-equal-to operator with arbitrary types
/*! \return !(*this == rhs)
*/
template
<
typename
T
>
bool
operator
!=
(
const
T
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
template
<
typename
T
>
RAPIDJSON_DISABLEIF_RETURN
((
internal
::
IsBaseOf
<
GenericValue
,
T
>
),
(
bool
))
operator
!=
(
const
T
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
//! Equal-to operator with arbitrary types (symmetric version)
/*! \return (rhs == lhs)
*/
template
<
typename
T
>
friend
bool
operator
==
(
const
T
&
lhs
,
const
GenericValue
&
rhs
)
{
return
rhs
==
lhs
;
}
template
<
typename
T
>
friend
RAPIDJSON_DISABLEIF_RETURN
((
internal
::
IsBaseOf
<
GenericValue
,
T
>
),
(
bool
))
operator
==
(
const
T
&
lhs
,
const
GenericValue
&
rhs
)
{
return
rhs
==
lhs
;
}
//! Not-Equal-to operator with arbitrary types (symmetric version)
/*! \return !(rhs == lhs)
*/
template
<
typename
T
>
friend
bool
operator
!=
(
const
T
&
lhs
,
const
GenericValue
&
rhs
)
{
return
!
(
rhs
==
lhs
);
}
template
<
typename
T
>
friend
RAPIDJSON_DISABLEIF_RETURN
((
internal
::
IsBaseOf
<
GenericValue
,
T
>
),
(
bool
))
operator
!=
(
const
T
&
lhs
,
const
GenericValue
&
rhs
)
{
return
!
(
rhs
==
lhs
);
}
//@}
//!@name Type
...
...
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