diff options
author | Milo Yip <miloyip@gmail.com> | 2022-02-09 05:48:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 05:48:05 +0300 |
commit | 88bbd87ddd28f45a8b8a983365becfa923174783 (patch) | |
tree | 36c8ac5d67f8c6d6acc1e1dc322382db1cdcd0b8 | |
parent | bf8ca5da88c57c34217901e588f6a1f163180180 (diff) |
Revert "Fix the alignment of placement new buffer for GenericValue."
-rw-r--r-- | include/rapidjson/document.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 92794744..e2cc6000 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<char *>(&buffer)) GenericValue(); + static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); } } template <typename SourceAllocator> |