more fixes for pointer
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5824 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
811a5065c3
commit
49a09a63fb
6 changed files with 27 additions and 5 deletions
|
|
@ -30,10 +30,26 @@
|
|||
%define %std_set_methods(set)
|
||||
%std_set_methods_common(set);
|
||||
#ifdef SWIG_EXPORT_ITERATOR_METHODS
|
||||
pair<iterator,bool> insert(const value_type& __x);
|
||||
iterator insert(iterator pos);
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %pyset_methods(set)
|
||||
%pycontainer_methods(set);
|
||||
|
||||
%extend {
|
||||
void append(value_type x) {
|
||||
self->insert(x);
|
||||
}
|
||||
|
||||
bool __contains__(value_type x) {
|
||||
return self->find(x) != self->end();
|
||||
}
|
||||
};
|
||||
|
||||
%enddef
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// std::set
|
||||
//
|
||||
|
|
@ -121,9 +137,8 @@ namespace std {
|
|||
%typemap_traits_ptr(SWIG_CCode(SET), std::set<T >);
|
||||
|
||||
%std_set_methods(set);
|
||||
%pycontainer_methods(std::set<T >);
|
||||
%pyset_methods(std::set<T >);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
%define %std_set_ptypen(...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue