added __rsub__() and test for reversed subtraction operator
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10337 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8c7d3c7ae3
commit
128880ea1d
2 changed files with 9 additions and 1 deletions
|
|
@ -183,6 +183,9 @@ inline bool operator>=(const Op& a,const Op& b){return a.i>=b.i;}
|
|||
bool operator> (const Op& b){return $self->i>b.i;}
|
||||
bool operator>=(const Op& b){return $self->i>=b.i;}
|
||||
|
||||
// subtraction with reversed arguments
|
||||
Op __rsub__(const int b){return Op(b - $self->i);}
|
||||
|
||||
// we also add the __str__() fn to the class
|
||||
// this allows it to be converted to a string (so it can be printed)
|
||||
const char* __str__()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue