From 07f97b19f1b2b5c0e548b38349a9a7aa16f73bde Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Thu, 11 Jul 2024 09:30:11 +0200 Subject: [PATCH] With move --- cpp/kiss_icp/core/Preprocessing.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/kiss_icp/core/Preprocessing.cpp b/cpp/kiss_icp/core/Preprocessing.cpp index 60c7ecc1..89c70f2d 100644 --- a/cpp/kiss_icp/core/Preprocessing.cpp +++ b/cpp/kiss_icp/core/Preprocessing.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -43,8 +44,10 @@ std::vector VoxelDownsample(const std::vector if (!grid.contains(voxel)) grid.insert({voxel, point}); }); std::vector frame_dowsampled(grid.size()); - std::transform(grid.begin(), grid.end(), frame_dowsampled.begin(), - [](const auto &voxel_and_point) { return voxel_and_point.second; }); + std::transform(std::make_move_iterator(grid.begin()), // + std::make_move_iterator(grid.end()), // + frame_dowsampled.begin(), + [](auto &&voxel_and_point) { return voxel_and_point.second; }); return frame_dowsampled; }