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
57772914
Unverified
Commit
57772914
authored
Sep 26, 2019
by
Milo Yip
Committed by
GitHub
Sep 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1579 from Tencent/vs2010
Fix VS2010 build via disabling copy constructor in GenericMember
parents
6006d6b6
88a1ba9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
document.h
include/rapidjson/document.h
+31
-1
fwd.h
include/rapidjson/fwd.h
+1
-1
No files found.
include/rapidjson/document.h
View file @
57772914
...
...
@@ -63,15 +63,45 @@ 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
:
name
(
std
::
move
(
rhs
.
name
)),
value
(
std
::
move
(
rhs
.
value
))
{
}
//! Move assignment in C++11
GenericMember
&
operator
=
(
GenericMember
&&
rhs
)
RAPIDJSON_NOEXCEPT
{
return
*
this
=
static_cast
<
GenericMember
&>
(
rhs
);
}
#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 @
57772914
...
...
@@ -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