Skip to content

Commit

Permalink
[std-array] array_indexing_suite: fix up set_sice from iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
ManifoldFR committed Nov 30, 2023
1 parent b1d0e16 commit ad2fa27
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions include/eigenpy/std-array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

namespace eigenpy {

template <typename Container, bool NoProxy,
class DerivedPolicies>
template <typename Container, bool NoProxy, class DerivedPolicies>
class array_indexing_suite;
namespace details {

Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}
}

Expand All @@ -80,7 +76,6 @@ class array_indexing_suite
}
};


template <typename array_type, bool NoProxy = false>
struct StdArrayPythonVisitor {
typedef typename array_type::value_type value_type;
Expand Down

0 comments on commit ad2fa27

Please sign in to comment.