mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Remove copy constructor to make flatbuffers struct trivially copyable… (#4476)
* Remove copy constructor to make flatbuffers struct trivially copyable + add tests. * Add support non c++11 compliant compilers. * Fix std::trivially_copyiable test for non-C++11 compliant compilers. * Fix trivially_copyable not part of glibc < 5 even with c++11 switch enabled.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
e2c7196ea8
commit
853f7033e0
@@ -2284,11 +2284,6 @@ class CppGenerator : public BaseGenerator {
|
||||
code_ += " memset(this, 0, sizeof({{STRUCT_NAME}}));";
|
||||
code_ += " }";
|
||||
|
||||
// Generate a copy constructor.
|
||||
code_ += " {{STRUCT_NAME}}(const {{STRUCT_NAME}} &_o) {";
|
||||
code_ += " memcpy(this, &_o, sizeof({{STRUCT_NAME}}));";
|
||||
code_ += " }";
|
||||
|
||||
// Generate a constructor that takes all fields as arguments.
|
||||
std::string arg_list;
|
||||
std::string init_list;
|
||||
|
||||
Reference in New Issue
Block a user