Fixes when using python -builtin and STL container wrappers.
Deletion of single elements previously failed. Test case li_std_containers_int now works.
This commit is contained in:
parent
49038b30b7
commit
a89a892843
2 changed files with 18 additions and 0 deletions
|
|
@ -874,6 +874,13 @@ namespace swig
|
|||
*(swig::getpos(self,i)) = x;
|
||||
}
|
||||
|
||||
#if defined(SWIGPYTHON_BUILTIN)
|
||||
// This will be called through the mp_ass_subscript slot to delete an entry.
|
||||
void __setitem__(difference_type i) throw (std::out_of_range) {
|
||||
self->erase(swig::getpos(self,i));
|
||||
}
|
||||
#endif
|
||||
|
||||
void append(const value_type& x) {
|
||||
self->push_back(x);
|
||||
}
|
||||
|
|
@ -892,6 +899,13 @@ namespace swig
|
|||
*(swig::getpos(self,i)) = x;
|
||||
}
|
||||
|
||||
#if defined(SWIGPYTHON_BUILTIN)
|
||||
// This will be called through the mp_ass_subscript slot to delete an entry.
|
||||
void __setitem__(difference_type i) throw (std::out_of_range) {
|
||||
self->erase(swig::getpos(self,i));
|
||||
}
|
||||
#endif
|
||||
|
||||
void append(value_type x) {
|
||||
self->push_back(x);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue