mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 20:20:00 +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
@@ -74,11 +74,13 @@ struct EquipmentUnion {
|
||||
flatbuffers::NativeTable *table;
|
||||
|
||||
EquipmentUnion() : type(Equipment_NONE), table(nullptr) {}
|
||||
EquipmentUnion(EquipmentUnion&& u):
|
||||
EquipmentUnion(EquipmentUnion&& u) FLATBUFFERS_NOEXCEPT :
|
||||
type(Equipment_NONE), table(nullptr)
|
||||
{ std::swap(type, u.type); std::swap(table, u.table); }
|
||||
EquipmentUnion(const EquipmentUnion &);
|
||||
EquipmentUnion &operator=(const EquipmentUnion &);
|
||||
EquipmentUnion &operator=(EquipmentUnion &&u) FLATBUFFERS_NOEXCEPT
|
||||
{ std::swap(type, u.type); std::swap(table, u.table); return *this; }
|
||||
~EquipmentUnion() { Reset(); }
|
||||
|
||||
void Reset();
|
||||
|
||||
Reference in New Issue
Block a user