Python builtin C++11 STL fixes
Compilation fixes for std::multimap, std::unordered_map and std::unordered_multimap.
This commit is contained in:
parent
4ab2aff0a1
commit
b56d7c0539
3 changed files with 30 additions and 0 deletions
|
|
@ -68,7 +68,17 @@
|
|||
|
||||
%define %swig_multimap_methods(Type...)
|
||||
%swig_map_common(Type);
|
||||
|
||||
#if defined(SWIGPYTHON_BUILTIN)
|
||||
%feature("python:slot", "mp_ass_subscript", functype="objobjargproc") __setitem__;
|
||||
#endif
|
||||
|
||||
%extend {
|
||||
// This will be called through the mp_ass_subscript slot to delete an entry.
|
||||
void __setitem__(const key_type& key) {
|
||||
self->erase(key);
|
||||
}
|
||||
|
||||
void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) {
|
||||
self->insert(Type::value_type(key,x));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue