mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 02:21:46 +00:00
[C++] Got rid of memset's in constructors (#5938)
* [C++] removed array's memsets from struct parametrized constructor now POD-typed arrays are zero-initialized and class-typed arrays are default-initialized * [C++] memset -> zero/default initialization in default constructor * [C++] Struct-type and array default initialization * [C++] Newly generated tests * [C++] forgotten test * [C++] curly brace by code style * [C++] test if memory is 0's after placement new * [C++] memory leak fix * [C++] simplifying and non-dynamic memory in test * [C++] code cleanup * [C++] disable old-compiler warning * [C++] windows build fix (try) * [C++] debug-new win build fix
This commit is contained in:
@@ -66,8 +66,9 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return StructInNestedNSTypeTable();
|
||||
}
|
||||
StructInNestedNS() {
|
||||
memset(static_cast<void *>(this), 0, sizeof(StructInNestedNS));
|
||||
StructInNestedNS()
|
||||
: a_(0),
|
||||
b_(0) {
|
||||
}
|
||||
StructInNestedNS(int32_t _a, int32_t _b)
|
||||
: a_(flatbuffers::EndianScalar(_a)),
|
||||
|
||||
Reference in New Issue
Block a user