mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 13:31:37 +00:00
[C++]Use noexcept in union type move ctor/Add move assingment (#4249)
* Use noexcept in union type move ctor/Add move assingment * Add NOEXCEPT macro to deal with _MS_VER/Remove delegating ctor in union type class * Add FLATBUFFERS_NOEXCEPT to generated union class
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
238a8ebb15
commit
2aec880347
@@ -105,11 +105,13 @@ struct AnyUnion {
|
||||
flatbuffers::NativeTable *table;
|
||||
|
||||
AnyUnion() : type(Any_NONE), table(nullptr) {}
|
||||
AnyUnion(AnyUnion&& u):
|
||||
AnyUnion(AnyUnion&& u) FLATBUFFERS_NOEXCEPT :
|
||||
type(Any_NONE), table(nullptr)
|
||||
{ std::swap(type, u.type); std::swap(table, u.table); }
|
||||
AnyUnion(const AnyUnion &);
|
||||
AnyUnion &operator=(const AnyUnion &);
|
||||
AnyUnion &operator=(AnyUnion &&u) FLATBUFFERS_NOEXCEPT
|
||||
{ std::swap(type, u.type); std::swap(table, u.table); return *this; }
|
||||
~AnyUnion() { Reset(); }
|
||||
|
||||
void Reset();
|
||||
|
||||
Reference in New Issue
Block a user