VS fix for ambiguous union assignment operator.

Change-Id: I1c37db1ced462fd558d3e893a501341f3eca6379
This commit is contained in:
Wouter van Oortmerssen
2017-04-17 18:00:41 -07:00
parent 46497e4f9a
commit 523f3833eb
4 changed files with 8 additions and 8 deletions

View File

@@ -109,8 +109,8 @@ struct AnyUnion {
type(Any_NONE), value(nullptr)
{ std::swap(type, u.type); std::swap(value, u.value); }
AnyUnion(const AnyUnion &) FLATBUFFERS_NOEXCEPT;
AnyUnion &operator=(AnyUnion u) FLATBUFFERS_NOEXCEPT
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
AnyUnion &operator=(const AnyUnion &u) FLATBUFFERS_NOEXCEPT
{ AnyUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
AnyUnion &operator=(AnyUnion &&u) FLATBUFFERS_NOEXCEPT
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
~AnyUnion() { Reset(); }

View File

@@ -56,8 +56,8 @@ struct CharacterUnion {
type(Character_NONE), value(nullptr)
{ std::swap(type, u.type); std::swap(value, u.value); }
CharacterUnion(const CharacterUnion &) FLATBUFFERS_NOEXCEPT;
CharacterUnion &operator=(CharacterUnion u) FLATBUFFERS_NOEXCEPT
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
CharacterUnion &operator=(const CharacterUnion &u) FLATBUFFERS_NOEXCEPT
{ CharacterUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
CharacterUnion &operator=(CharacterUnion &&u) FLATBUFFERS_NOEXCEPT
{ std::swap(type, u.type); std::swap(value, u.value); return *this; }
~CharacterUnion() { Reset(); }