Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Yip <miloyip@gmail.com>2022-02-09 05:48:05 +0300
committerGitHub <noreply@github.com>2022-02-09 05:48:05 +0300
commit88bbd87ddd28f45a8b8a983365becfa923174783 (patch)
tree36c8ac5d67f8c6d6acc1e1dc322382db1cdcd0b8
parentbf8ca5da88c57c34217901e588f6a1f163180180 (diff)
Revert "Fix the alignment of placement new buffer for GenericValue."
-rw-r--r--include/rapidjson/document.h4
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>