add && and ||
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7744 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6bb15233ce
commit
4bbdb28c98
1 changed files with 5 additions and 0 deletions
|
|
@ -32,6 +32,8 @@ see bottom for a set of possible tests
|
|||
%rename(LessThanEqual) operator <=;
|
||||
%rename(GreaterThan) operator >;
|
||||
%rename(GreaterThanEqual) operator >=;
|
||||
%rename(And) operator &&;
|
||||
%rename(Or) operator ||;
|
||||
#endif
|
||||
|
||||
%inline %{
|
||||
|
|
@ -61,6 +63,9 @@ public:
|
|||
friend Op operator/(const Op& a,const Op& b){return Op(a.i/b.i);}
|
||||
friend Op operator%(const Op& a,const Op& b){return Op(a.i%b.i);}
|
||||
|
||||
friend Op operator&&(const Op& a,const Op& b){return Op(a.i&&b.i);}
|
||||
friend Op operator||(const Op& a,const Op& b){return Op(a.i||b.i);}
|
||||
|
||||
// unary operators
|
||||
Op operator-() const {return Op(-i);}
|
||||
bool operator!() const {return !(i);}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue