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
5656078a
Commit
5656078a
authored
Aug 31, 2014
by
Philipp A. Hartmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detect rvalue reference support (RAPIDJSON_HAS_CXX11_RVALUE_REFS)
parent
a16fe366
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
document.h
include/rapidjson/document.h
+2
-2
meta.h
include/rapidjson/internal/meta.h
+2
-2
rapidjson.h
include/rapidjson/rapidjson.h
+20
-0
No files found.
include/rapidjson/document.h
View file @
5656078a
...
...
@@ -416,7 +416,7 @@ public:
//! Default constructor creates a null value.
GenericValue
()
:
data_
(),
flags_
(
kNullFlag
)
{}
#if
def RAPIDJSON_CXX11
#if
RAPIDJSON_HAS_CXX11_RVALUE_REFS
//! Move constructor in C++11
GenericValue
(
GenericValue
&&
rhs
)
:
data_
(
rhs
.
data_
),
flags_
(
rhs
.
flags_
)
{
rhs
.
flags_
=
kNullFlag
;
// give up contents
...
...
@@ -574,7 +574,7 @@ public:
return
*
this
;
}
#if
def RAPIDJSON_CXX11
#if
RAPIDJSON_HAS_CXX11_RVALUE_REFS
//! Move assignment in C++11
GenericValue
&
operator
=
(
GenericValue
&&
rhs
)
{
return
*
this
=
rhs
.
Move
();
...
...
include/rapidjson/internal/meta.h
View file @
5656078a
...
...
@@ -34,7 +34,7 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF
(
6334
)
#endif
#if
def
RAPIDJSON_HAS_CXX11_TYPETRAITS
#if RAPIDJSON_HAS_CXX11_TYPETRAITS
#include <type_traits>
#endif
...
...
@@ -102,7 +102,7 @@ template <typename T> struct IsPointer<T*> : TrueType {};
///////////////////////////////////////////////////////////////////////////////
// IsBaseOf
//
#if
def
RAPIDJSON_HAS_CXX11_TYPETRAITS
#if RAPIDJSON_HAS_CXX11_TYPETRAITS
template
<
typename
B
,
typename
D
>
struct
IsBaseOf
:
BoolType
<
::
std
::
is_base_of
<
B
,
D
>::
value
>
{};
...
...
include/rapidjson/rapidjson.h
View file @
5656078a
...
...
@@ -357,6 +357,26 @@ template<int x> struct StaticAssertTest {};
#endif // RAPIDJSON_DIAG_*
///////////////////////////////////////////////////////////////////////////////
// C++11 features
#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS
#if defined(__clang__)
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS __has_feature(cxx_rvalue_references)
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
(
defined
(
_MSC_VER
)
&&
_MSC_VER
>=
1600
)
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
#else
#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
#endif
#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
// no automatic detection, yet
#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS
#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0
#endif
//!@endcond
///////////////////////////////////////////////////////////////////////////////
...
...
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