From ad2fa27d3b642596ab3fe3d49bfa19ec82d6bfae Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Thu, 30 Nov 2023 19:04:08 +0100 Subject: [PATCH] [std-array] array_indexing_suite: fix up set_sice from iterators --- include/eigenpy/std-array.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/eigenpy/std-array.hpp b/include/eigenpy/std-array.hpp index f1ec652b6..7e29e1ed7 100644 --- a/include/eigenpy/std-array.hpp +++ b/include/eigenpy/std-array.hpp @@ -10,8 +10,7 @@ namespace eigenpy { -template +template class array_indexing_suite; namespace details { @@ -45,8 +44,7 @@ class array_indexing_suite static void delete_item(Container &, index_type) {} // no-op // no-op - static void delete_slice(Container &, index_type, - index_type) {} + static void delete_slice(Container &, index_type, index_type) {} static void set_slice(Container &container, index_type from, index_type to, data_type const &v) { @@ -61,11 +59,9 @@ class array_indexing_suite static void set_slice(Container &container, index_type from, index_type to, Iter first, Iter last) { if (from > to) { - // container.insert(container.begin() + from, first, last); return; } else { - // container.erase(container.begin() + from, container.begin() + to); - // container.insert(container.begin() + from, first, last); + std::copy(first, last, container.begin() + from); } } @@ -80,7 +76,6 @@ class array_indexing_suite } }; - template struct StdArrayPythonVisitor { typedef typename array_type::value_type value_type;