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; } }