1 %module cpp11_ref_qualifiers_typemaps
2 
3 %typemap(in) SWIGTYPE (CLASS::*) %{
4   _this_will_fail_to_compile_if_used_
5 %}
6 
7 // typemaps to completely ignore the input parm and override it
8 %typemap(in) short (Funcs::*ff)(bool) const   %{ $1 = &Funcs::FFF2; %}
9 %typemap(in) short (Funcs::*cc)(bool) &       %{ $1 = &Funcs::CCC5; %}
10 %typemap(in) short (Funcs::*gg)(bool) const & %{ $1 = &Funcs::GGG8; %}
11 %typemap(in) short (Funcs::*hh)(bool) &&      %{ $1 = &Funcs::HHH11; %}
12 
13 %typemap(in) short (Funcs::*)(bool) const   %{ $1 = &Funcs::FFF3; %}
14 %typemap(in) short (Funcs::*)(bool) &       %{ $1 = &Funcs::CCC6; %}
15 %typemap(in) short (Funcs::*)(bool) const & %{ $1 = &Funcs::GGG9; %}
16 %typemap(in) short (Funcs::*)(bool) &&      %{ $1 = &Funcs::HHH12; %}
17 
18 %inline %{
19 struct Funcs {
FFF1Funcs20   short FFF1(bool) const { return 1; }
FFF2Funcs21   short FFF2(bool) const { return 2; }
FFF3Funcs22   short FFF3(bool) const { return 3; }
CCC4Funcs23   short CCC4(bool) & { return 4; }
CCC5Funcs24   short CCC5(bool) & { return 5; }
CCC6Funcs25   short CCC6(bool) & { return 6; }
GGG7Funcs26   short GGG7(bool) const & { return 7; }
GGG8Funcs27   short GGG8(bool) const & { return 8; }
GGG9Funcs28   short GGG9(bool) const & { return 9; }
HHH10Funcs29   short HHH10(bool) && { return 10; }
HHH11Funcs30   short HHH11(bool) && { return 11; }
HHH12Funcs31   short HHH12(bool) && { return 12; }
32 };
33 struct TypemapsNamedParms
34 {
fffTypemapsNamedParms35   short fff(short (Funcs::*ff)(bool) const) {
36     Funcs funcs;
37     return (funcs.*ff)(true);
38   }
cccTypemapsNamedParms39   short ccc(short (Funcs::*cc)(bool) &) {
40     Funcs funcs;
41     return (funcs.*cc)(true);
42   }
gggTypemapsNamedParms43   short ggg(short (Funcs::*gg)(bool) const &) {
44     Funcs funcs;
45     return (funcs.*gg)(true);
46   }
hhhTypemapsNamedParms47   short hhh(short (Funcs::*hh)(bool) &&) {
48     return (Funcs().*hh)(true);
49   }
50 };
51 struct TypemapsUnnamedParms
52 {
fffTypemapsUnnamedParms53   short fff(short (Funcs::*f)(bool) const) {
54     Funcs funcs;
55     return (funcs.*f)(true);
56   }
cccTypemapsUnnamedParms57   short ccc(short (Funcs::*c)(bool) &) {
58     Funcs funcs;
59     return (funcs.*c)(true);
60   }
gggTypemapsUnnamedParms61   short ggg(short (Funcs::*g)(bool) const &) {
62     Funcs funcs;
63     return (funcs.*g)(true);
64   }
hhhTypemapsUnnamedParms65   short hhh(short (Funcs::*h)(bool) &&) {
66     return (Funcs().*h)(true);
67   }
68 };
69 %}
70 
71 %constant short (Funcs::*FF1_MFP)(bool) const = &Funcs::FFF1;
72 %constant short (Funcs::*CC4_MFP)(bool) & = &Funcs::CCC4;
73 %constant short (Funcs::*GG7_MFP)(bool) const & = &Funcs::GGG7;
74 %constant short (Funcs::*HH10_MFP)(bool) && = &Funcs::HHH10;
75