File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ CPP_TEST_CASES += \
184
184
director_classes \
185
185
director_classic \
186
186
director_constructor \
187
+ director_conversion_operators \
187
188
director_default \
188
189
director_detect \
189
190
director_enum \
Original file line number Diff line number Diff line change
1
+ %module (directors=" 1" ) director_conversion_operators
2
+
3
+ %feature(" director" );
4
+
5
+ %warnfilter(SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) Bar;
6
+
7
+ %rename(toFoo) Bar::operator Foo ();
8
+ %rename(toFooPtr) Bar::operator Foo *();
9
+ %rename(toFooRef) Bar::operator Foo &();
10
+ %rename(toFooPtrRef) Bar::operator Foo *&();
11
+
12
+ %rename(toOtherFoo) Bar::operator OtherFoo ();
13
+ %rename(toOtherFooPtr) Bar::operator OtherFoo *();
14
+ %rename(toOtherFooRef) Bar::operator OtherFoo &();
15
+ %rename(toOtherFooPtrRef) Bar::operator OtherFoo *&();
16
+
17
+ %inline %{
18
+ struct Foo {
19
+ };
20
+ struct OtherFoo {
21
+ };
22
+ struct Bar {
23
+ Foo myFoo;
24
+ Foo *myFooPtr;
25
+ virtual ~Bar () { }
26
+ virtual operator Foo () { return Foo (); }
27
+ virtual operator Foo *() { return &myFoo; }
28
+ virtual operator Foo &() { return myFoo; }
29
+ virtual operator Foo *&() { return myFooPtr; }
30
+ virtual operator OtherFoo () = 0;
31
+ virtual operator OtherFoo *() = 0 ;
32
+ virtual operator OtherFoo &() = 0 ;
33
+ virtual operator OtherFoo *&() = 0 ;
34
+ };
35
+ %}
You can’t perform that action at this time.
0 commit comments