diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 889cdfa..1b3a4f3 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1748,6 +1748,13 @@ public: typedef GenericValue ValueType; //!< Value type of the document. typedef Allocator AllocatorType; //!< Allocator type from template parameter. + GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + GenericValue(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator()); + } + //! Constructor /*! \param allocator Optional allocator for allocating memory. \param stackCapacity Optional initial capacity of stack in bytes.