diff options
author | Milo Yip <miloyip@gmail.com> | 2022-02-09 05:47:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 05:47:25 +0300 |
commit | bf8ca5da88c57c34217901e588f6a1f163180180 (patch) | |
tree | a62e65cd90d7e3c52d17c4965eb2ddd92b3c621c | |
parent | fd3dc29a5c2852df569e1ea81dbde2c412ac5051 (diff) | |
parent | 5b242b6b2d63b8d5cb422fbe740cdfce3edca3b5 (diff) |
Merge pull request #1987 from adamcalhoon/fix-placement-new-alignment
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 e2cc6000..92794744 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 char buffer[sizeof(GenericValue)]; - return *new (buffer) GenericValue(); + static GenericValid buffer; + return *new (reinterpret_cast<char *>(&buffer)) GenericValue(); } } template <typename SourceAllocator> |