Skip to content

Commit 181c48d

Browse files
committed
Reset index after move construction
1 parent f33d582 commit 181c48d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

iceoryx_hoofs/vocabulary/include/iox/detail/variant.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ inline constexpr variant<Types...>::variant(variant&& rhs) noexcept
9797
if (m_type_index != INVALID_VARIANT_INDEX)
9898
{
9999
internal::call_at_index<0, Types...>::moveConstructor(m_type_index, &rhs.m_storage, &m_storage);
100+
rhs.m_type_index = INVALID_VARIANT_INDEX;
100101
}
101102
}
102103

0 commit comments

Comments
 (0)