mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 21:30:03 +00:00
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:
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user