forked from BigfootDev/flatbuffers
This commit is contained in:
@@ -1534,7 +1534,8 @@ class CppGenerator : public BaseGenerator {
|
|||||||
code_.SetValue("TYPE", GetUnionElement(ev, true, opts_));
|
code_.SetValue("TYPE", GetUnionElement(ev, true, opts_));
|
||||||
code_ += " case {{LABEL}}: {";
|
code_ += " case {{LABEL}}: {";
|
||||||
bool copyable = true;
|
bool copyable = true;
|
||||||
if (ev.union_type.base_type == BASE_TYPE_STRUCT) {
|
if (ev.union_type.base_type == BASE_TYPE_STRUCT &&
|
||||||
|
!ev.union_type.struct_def->fixed) {
|
||||||
// Don't generate code to copy if table is not copyable.
|
// Don't generate code to copy if table is not copyable.
|
||||||
// TODO(wvo): make tables copyable instead.
|
// TODO(wvo): make tables copyable instead.
|
||||||
for (auto fit = ev.union_type.struct_def->fields.vec.begin();
|
for (auto fit = ev.union_type.struct_def->fields.vec.begin();
|
||||||
|
|||||||
Reference in New Issue
Block a user