summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authormoti <motohiko.ave@gmail.com>2017-03-30 10:00:20 +0900
committerWouter van Oortmerssen <aardappel@gmail.com>2017-03-29 18:00:20 -0700
commit2aec880347394c04862dbbba3a1c09740e3a2198 (patch)
tree41f0459dc3b59073945a584dabbde829d799e7cf /samples
parent238a8ebb158dc0a672590a40e15715876e837db7 (diff)
downloadflatbuffers-2aec880347394c04862dbbba3a1c09740e3a2198.tar.gz
flatbuffers-2aec880347394c04862dbbba3a1c09740e3a2198.tar.bz2
flatbuffers-2aec880347394c04862dbbba3a1c09740e3a2198.zip
[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
Diffstat (limited to 'samples')
-rw-r--r--samples/monster_generated.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/monster_generated.h b/samples/monster_generated.h
index 464fc176..05633d96 100644
--- a/samples/monster_generated.h
+++ b/samples/monster_generated.h
@@ -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();