From 2bc9bf0737b30b960f845117f809de8611857e0b Mon Sep 17 00:00:00 2001 From: Jeff Ithier Date: Wed, 13 Nov 2024 11:19:21 +0100 Subject: [PATCH] [#490] Explicitly require move when using initializer function --- iceoryx2-ffi/cxx/include/iox2/sample_mut_uninit.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iceoryx2-ffi/cxx/include/iox2/sample_mut_uninit.hpp b/iceoryx2-ffi/cxx/include/iox2/sample_mut_uninit.hpp index b90dc6489..286cbc258 100644 --- a/iceoryx2-ffi/cxx/include/iox2/sample_mut_uninit.hpp +++ b/iceoryx2-ffi/cxx/include/iox2/sample_mut_uninit.hpp @@ -177,7 +177,7 @@ inline void SampleMutUninit::write_from_fn( const iox::function& 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))); } }