diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 9279474..e2cc600 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1235,8 +1235,8 @@ public: // return NullValue; // Use static buffer and placement-new to prevent destruction - static GenericValid buffer; - return *new (reinterpret_cast(&buffer)) GenericValue(); + static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); } } template