diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-10-31 09:56:13 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-10-31 09:56:13 +0000 |
commit | cda225ea325ed90da5a811838c07809e3dbc0731 (patch) | |
tree | 06909906b37f106b062d8842bf5c2f66c78fc413 /Lib/python/std_set.i | |
parent | f1c9638b6a6fcfaff1c1821d6d7b4b2d839dbbea (diff) | |
download | swig-cda225ea325ed90da5a811838c07809e3dbc0731.tar.gz |
add iterator support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7766 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/python/std_set.i')
-rw-r--r-- | Lib/python/std_set.i | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Lib/python/std_set.i b/Lib/python/std_set.i index c5f43dd68..0643b6ca1 100644 --- a/Lib/python/std_set.i +++ b/Lib/python/std_set.i @@ -36,21 +36,23 @@ %} %define %swig_set_methods(set...) + %swig_sequence_iterator(set); %swig_container_methods(set); %extend { - void append(value_type x) { - self->insert(x); - } + void append(value_type x) { + self->insert(x); + } - bool __contains__(value_type x) { - return self->find(x) != self->end(); - } - - value_type __getitem__(difference_type i) const throw (std::out_of_range) { - return *(swig::cgetpos(self, i)); - } - }; + bool __contains__(value_type x) { + return self->find(x) != self->end(); + } + + value_type __getitem__(difference_type i) const throw (std::out_of_range) { + return *(swig::cgetpos(self, i)); + } + + }; %enddef %include <std/std_set.i> |