Fixed clang needing union copy constructor.
Move constructors are present, which it should use instead. This is a temp fix to make it compile, but eventually we should generate a proper copy constructor just in-case people want to copy objects with unions. Tested on: Linux, OS X. Change-Id: Idf85419995c96f5959061882157541573e306083
This commit is contained in:
parent
a07f0d428d
commit
728bb64fed
|
@ -77,8 +77,8 @@ struct EquipmentUnion {
|
|||
EquipmentUnion(EquipmentUnion&& u) FLATBUFFERS_NOEXCEPT :
|
||||
type(Equipment_NONE), value(nullptr)
|
||||
{ std::swap(type, u.type); std::swap(value, u.value); }
|
||||
EquipmentUnion(const EquipmentUnion &);
|
||||
EquipmentUnion &operator=(const EquipmentUnion &);
|
||||
EquipmentUnion(const EquipmentUnion &) { assert(false); }
|
||||
EquipmentUnion &operator=(const EquipmentUnion &) { assert(false); return *this; }
|
||||
EquipmentUnion &operator=(EquipmentUnion &&u) FLATBUFFERS_NOEXCEPT
|
||||
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
|
||||
~EquipmentUnion() { Reset(); }
|
||||
|
|
|
@ -687,8 +687,8 @@ class CppGenerator : public BaseGenerator {
|
|||
code_ += " {{NAME}}Union({{NAME}}Union&& u) FLATBUFFERS_NOEXCEPT :";
|
||||
code_ += " type({{NONE}}), value(nullptr)";
|
||||
code_ += " { std::swap(type, u.type); std::swap(value, u.value); }";
|
||||
code_ += " {{NAME}}Union(const {{NAME}}Union &);";
|
||||
code_ += " {{NAME}}Union &operator=(const {{NAME}}Union &);";
|
||||
code_ += " {{NAME}}Union(const {{NAME}}Union &) { assert(false); }";
|
||||
code_ += " {{NAME}}Union &operator=(const {{NAME}}Union &) { assert(false); return *this; }";
|
||||
code_ += " {{NAME}}Union &operator=({{NAME}}Union &&u) FLATBUFFERS_NOEXCEPT";
|
||||
code_ += " { std::swap(type, u.type); std::swap(value, u.value); return *this; }";
|
||||
code_ += " ~{{NAME}}Union() { Reset(); }";
|
||||
|
|
|
@ -108,8 +108,8 @@ struct AnyUnion {
|
|||
AnyUnion(AnyUnion&& u) FLATBUFFERS_NOEXCEPT :
|
||||
type(Any_NONE), value(nullptr)
|
||||
{ std::swap(type, u.type); std::swap(value, u.value); }
|
||||
AnyUnion(const AnyUnion &);
|
||||
AnyUnion &operator=(const AnyUnion &);
|
||||
AnyUnion(const AnyUnion &) { assert(false); }
|
||||
AnyUnion &operator=(const AnyUnion &) { assert(false); return *this; }
|
||||
AnyUnion &operator=(AnyUnion &&u) FLATBUFFERS_NOEXCEPT
|
||||
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
|
||||
~AnyUnion() { Reset(); }
|
||||
|
|
|
@ -55,8 +55,8 @@ struct CharacterUnion {
|
|||
CharacterUnion(CharacterUnion&& u) FLATBUFFERS_NOEXCEPT :
|
||||
type(Character_NONE), value(nullptr)
|
||||
{ std::swap(type, u.type); std::swap(value, u.value); }
|
||||
CharacterUnion(const CharacterUnion &);
|
||||
CharacterUnion &operator=(const CharacterUnion &);
|
||||
CharacterUnion(const CharacterUnion &) { assert(false); }
|
||||
CharacterUnion &operator=(const CharacterUnion &) { assert(false); return *this; }
|
||||
CharacterUnion &operator=(CharacterUnion &&u) FLATBUFFERS_NOEXCEPT
|
||||
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
|
||||
~CharacterUnion() { Reset(); }
|
||||
|
|
Loading…
Reference in New Issue