Skip to content

Commit

Permalink
[#490] Explicitly require move when using initializer function
Browse files Browse the repository at this point in the history
  • Loading branch information
orecham committed Nov 13, 2024
1 parent c65c1f4 commit 2bc9bf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/include/iox2/sample_mut_uninit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ inline void SampleMutUninit<S, Payload, UserHeader>::write_from_fn(
const iox::function<typename T::ValueType(uint64_t)>& initializer) {
auto slice = payload_mut();
for (uint64_t i = 0; i < slice.number_of_elements(); ++i) {
new (&slice[i]) typename T::ValueType(initializer(i));
new (&slice[i]) typename T::ValueType(std::move(initializer(i)));
}
}

Expand Down

0 comments on commit 2bc9bf0

Please sign in to comment.