projects
/
external
/
swig.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
import source from 1.3.40
[external/swig.git]
/
Examples
/
test-suite
/
smart_pointer_multi.i
1
// Test cases for classes that do *NOT* result in smart-pointer wrapping
2
%module smart_pointer_multi
3
4
%inline %{
5
struct Foo {
6
int x;
7
int getx() { return x; }
8
};
9
10
class Bar {
11
Foo *f;
12
public:
13
Bar(Foo *f) : f(f) { }
14
Foo *operator->() {
15
return f;
16
}
17
};
18
19
class Spam {
20
Bar *b;
21
public:
22
Spam(Bar *b) : b(b) { }
23
Bar operator->() {
24
return *b;
25
}
26
};
27
28
class Grok {
29
Bar *b;
30
public:
31
Grok(Bar *b) : b(b) { }
32
Bar &operator->() {
33
return *b;
34
}
35
};
36
37
%}
38
39