Skip to content

Commit

Permalink
Move constructor support for PrettyWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
CreoValis committed Sep 19, 2016
1 parent ccd13e3 commit a5e6ba2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/rapidjson/prettywriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(effc++)
#endif

#if defined(__clang__)
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(c++98-compat)
#endif

RAPIDJSON_NAMESPACE_BEGIN

//! Combination of PrettyWriter format flags.
Expand Down Expand Up @@ -57,6 +62,11 @@ class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding,
explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}

#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
explicit PrettyWriter(PrettyWriter&& rhs) :
Base(std::forward(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {}
#endif

//! Set custom indentation.
/*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r').
\param indentCharCount Number of indent characters for each indentation level.
Expand Down Expand Up @@ -254,6 +264,10 @@ class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding,

RAPIDJSON_NAMESPACE_END

#if defined(__clang__)
RAPIDJSON_DIAG_POP
#endif

#ifdef __GNUC__
RAPIDJSON_DIAG_POP
#endif
Expand Down

0 comments on commit a5e6ba2

Please sign in to comment.