Skip to content

Commit

Permalink
Move constructor support for Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
CreoValis committed Sep 19, 2016
1 parent 5268211 commit 49540ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/rapidjson/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ class Writer {
Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) :
os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}

#ifdef RAPIDJSON_HAS_CXX11_RVALUE_REFS
Writer(Writer &&other) :
os_(other.os_), level_stack_(std::move(other.level_stack_)), maxDecimalPlaces_(other.maxDecimalPlaces_), hasRoot_(other.hasRoot_)
{
other.os_=nullptr;
}
#endif

//! Reset the writer with a new stream.
/*!
This function reset the writer with a new stream and default settings,
Expand Down

0 comments on commit 49540ac

Please sign in to comment.