Skip to content

Commit

Permalink
[std-array] array_indexing_suite::delete_item and ::delete_slice will…
Browse files Browse the repository at this point in the history
… throw Python exceptions
  • Loading branch information
ManifoldFR committed Dec 4, 2023
1 parent f4d61cc commit 2c18089
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions include/eigenpy/std-array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,19 @@ class array_indexing_suite
template <class Class>
static void extension_def(Class &) {}

// no-op
static void delete_item(Container &, index_type) {}
// no-op
// no-op
static void delete_slice(Container &, index_type, index_type) {}
// throws exception
static void delete_item(Container &, index_type) {
PyErr_SetString(PyExc_NotImplementedError,
"Cannot delete item from std::array type.");
bp::throw_error_already_set();
}

// throws exception
static void delete_slice(Container &, index_type, index_type) {
PyErr_SetString(PyExc_NotImplementedError,
"Cannot delete slice from std::array type.");
bp::throw_error_already_set();
}

static void set_slice(Container &container, index_type from, index_type to,
data_type const &v) {
Expand Down

0 comments on commit 2c18089

Please sign in to comment.