From 523f3833eb2ddd41e891c3ef8f3c5d4f154916b6 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 17 Apr 2017 18:00:41 -0700 Subject: VS fix for ambiguous union assignment operator. Change-Id: I1c37db1ced462fd558d3e893a501341f3eca6379 --- samples/monster_generated.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'samples') diff --git a/samples/monster_generated.h b/samples/monster_generated.h index e1a1e7e1..fb261849 100644 --- a/samples/monster_generated.h +++ b/samples/monster_generated.h @@ -78,8 +78,8 @@ struct EquipmentUnion { type(Equipment_NONE), value(nullptr) { std::swap(type, u.type); std::swap(value, u.value); } EquipmentUnion(const EquipmentUnion &) FLATBUFFERS_NOEXCEPT; - EquipmentUnion &operator=(EquipmentUnion u) FLATBUFFERS_NOEXCEPT - { std::swap(type, u.type); std::swap(value, u.value); return *this; } + EquipmentUnion &operator=(const EquipmentUnion &u) FLATBUFFERS_NOEXCEPT + { EquipmentUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; } EquipmentUnion &operator=(EquipmentUnion &&u) FLATBUFFERS_NOEXCEPT { std::swap(type, u.type); std::swap(value, u.value); return *this; } ~EquipmentUnion() { Reset(); } -- cgit v1.2.3