From 181c48de81bb3a5686823e357cc9011c36a104a5 Mon Sep 17 00:00:00 2001 From: Xingyang Yuan Date: Thu, 16 Jan 2025 19:59:35 +0800 Subject: [PATCH] Reset index after move construction --- iceoryx_hoofs/vocabulary/include/iox/detail/variant.inl | 1 + 1 file changed, 1 insertion(+) diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/variant.inl b/iceoryx_hoofs/vocabulary/include/iox/detail/variant.inl index 537dd48a0a..d1e4f4c1b0 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/variant.inl +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/variant.inl @@ -97,6 +97,7 @@ inline constexpr variant::variant(variant&& rhs) noexcept if (m_type_index != INVALID_VARIANT_INDEX) { internal::call_at_index<0, Types...>::moveConstructor(m_type_index, &rhs.m_storage, &m_storage); + rhs.m_type_index = INVALID_VARIANT_INDEX; } }