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:
parent
81b755dadc
commit
049035ff3e
3 changed files with 21 additions and 0 deletions
|
|
@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 2.0.8 (in progress)
|
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
|
2012-08-15: wsfulton
|
||||||
[Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3.
|
[Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,11 @@ assert issubclass(IntSet, MutableSet)
|
||||||
assert issubclass(IntMultiset, MutableSet)
|
assert issubclass(IntMultiset, MutableSet)
|
||||||
assert issubclass(IntVector, MutableSequence)
|
assert issubclass(IntVector, MutableSequence)
|
||||||
assert issubclass(IntList, MutableSequence)
|
assert issubclass(IntList, MutableSequence)
|
||||||
|
|
||||||
|
mapii = Mapii()
|
||||||
|
multimapii = Multimapii()
|
||||||
|
intset = IntSet()
|
||||||
|
intmultiset = IntMultiset()
|
||||||
|
intvector = IntVector()
|
||||||
|
intlist = IntList()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,14 @@
|
||||||
return *(swig::cgetpos(self, i));
|
return *(swig::cgetpos(self, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void add(value_type x) {
|
||||||
|
self->insert(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
void discard(value_type x) {
|
||||||
|
self->erase(x);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue