fix bug #1480074
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9085 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
553c551fef
commit
b319720cf1
2 changed files with 18 additions and 6 deletions
|
|
@ -132,7 +132,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
%define %swig_map_methods(Map...)
|
||||
%define %swig_map_common(Map...)
|
||||
%swig_sequence_iterator(Map);
|
||||
%swig_container_methods(Map)
|
||||
|
||||
|
|
@ -145,10 +145,6 @@
|
|||
throw std::out_of_range("key not found");
|
||||
}
|
||||
|
||||
void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) {
|
||||
self->insert(Map::value_type(key,x));
|
||||
}
|
||||
|
||||
void __delitem__(const key_type& key) throw (std::out_of_range) {
|
||||
Map::iterator i = self->find(key);
|
||||
if (i != self->end())
|
||||
|
|
@ -238,5 +234,14 @@
|
|||
}
|
||||
%enddef
|
||||
|
||||
%define %swig_map_methods(Map...)
|
||||
%swig_map_common(Map)
|
||||
%extend {
|
||||
void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) {
|
||||
(*self)[key] = x;
|
||||
}
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
||||
%include <std/std_map.i>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue