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
c36b713c
Commit
c36b713c
authored
Sep 25, 2019
by
Milo Yip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable copy constructor in GenericMember
parent
6006d6b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
document.h
include/rapidjson/document.h
+25
-1
fwd.h
include/rapidjson/fwd.h
+1
-1
No files found.
include/rapidjson/document.h
View file @
c36b713c
...
...
@@ -63,15 +63,39 @@ class GenericDocument;
https://code.google.com/p/rapidjson/issues/detail?id=64
*/
template
<
typename
Encoding
,
typename
Allocator
>
struct
GenericMember
{
class
GenericMember
{
public
:
GenericValue
<
Encoding
,
Allocator
>
name
;
//!< name of member (must be a string)
GenericValue
<
Encoding
,
Allocator
>
value
;
//!< value of member.
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
//! Move constructor in C++11
GenericMember
(
GenericMember
&&
rhs
)
RAPIDJSON_NOEXCEPT
=
default
;
//! Move assignment in C++11
GenericMember
&
operator
=
(
GenericMember
&&
rhs
)
RAPIDJSON_NOEXCEPT
=
default
;
#endif
//! Assignment with move semantics.
/*! \param rhs Source of the assignment. Its name and value will become a null value after assignment.
*/
GenericMember
&
operator
=
(
GenericMember
&
rhs
)
RAPIDJSON_NOEXCEPT
{
if
(
RAPIDJSON_LIKELY
(
this
!=
&
rhs
))
{
name
=
rhs
.
name
;
value
=
rhs
.
value
;
}
return
*
this
;
}
// swap() for std::sort() and other potential use in STL.
friend
inline
void
swap
(
GenericMember
&
a
,
GenericMember
&
b
)
RAPIDJSON_NOEXCEPT
{
a
.
name
.
Swap
(
b
.
name
);
a
.
value
.
Swap
(
b
.
value
);
}
private
:
//! Copy constructor is not permitted.
GenericMember
(
const
GenericMember
&
rhs
);
};
///////////////////////////////////////////////////////////////////////////////
...
...
include/rapidjson/fwd.h
View file @
c36b713c
...
...
@@ -102,7 +102,7 @@ class PrettyWriter;
// document.h
template
<
typename
Encoding
,
typename
Allocator
>
struct
GenericMember
;
class
GenericMember
;
template
<
bool
Const
,
typename
Encoding
,
typename
Allocator
>
class
GenericMemberIterator
;
...
...
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