Add discard and add methods to std::set and std::multiset wrappers so that pyabc.i can be used ensuring MutableSet is a valid abstract base class

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13619 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-08-15 22:36:15 +00:00
commit 049035ff3e
3 changed files with 21 additions and 0 deletions

View file

@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.8 (in progress)
===========================
2012-08-15: wsfulton
[Python] Add discard and add methods to std::set wrappers so that pyabc.i can be used ensuring
MutableSet is a valid abstract base class for std::set. As reported by Alexey Sokolov.
Similarly for std::multiset.
2012-08-15: wsfulton
[Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3.

View file

@ -10,3 +10,11 @@ assert issubclass(IntSet, MutableSet)
assert issubclass(IntMultiset, MutableSet)
assert issubclass(IntVector, MutableSequence)
assert issubclass(IntList, MutableSequence)
mapii = Mapii()
multimapii = Multimapii()
intset = IntSet()
intmultiset = IntMultiset()
intvector = IntVector()
intlist = IntList()

View file

@ -49,6 +49,14 @@
return *(swig::cgetpos(self, i));
}
void add(value_type x) {
self->insert(x);
}
void discard(value_type x) {
self->erase(x);
}
};
%enddef