Test operator pointer casts
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9537 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
599d64e188
commit
69fcd3ccb8
1 changed files with 20 additions and 1 deletions
|
|
@ -39,13 +39,32 @@
|
|||
};
|
||||
%}
|
||||
|
||||
%rename(OpInt) operator int;
|
||||
%rename(OpInt) operator int();
|
||||
%rename(OpIntStarStarConst) operator int **() const;
|
||||
%rename(OpIntAmp) operator int &();
|
||||
%rename(OpIntStar) operator void *();
|
||||
%rename(OpConstIntIntStar) operator const int *();
|
||||
|
||||
%inline %{
|
||||
class Ops {
|
||||
public:
|
||||
Ops() : num(0) {}
|
||||
virtual ~Ops() {}
|
||||
virtual operator int() { return 0; }
|
||||
virtual operator int **() const {
|
||||
return (int **) 0;
|
||||
}
|
||||
virtual operator int &() {
|
||||
return num;
|
||||
}
|
||||
virtual operator void *() {
|
||||
return (void *) this;
|
||||
}
|
||||
virtual operator const int *() {
|
||||
return #
|
||||
}
|
||||
private:
|
||||
int num;
|
||||
};
|
||||
|
||||
struct Prims {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue