1
1
%module template_default
3
template <class T1, class T2 = T1>
9
%template(A_ii) A<int, int>;
10
%template(A_d) A<double>;
5
%warnfilter(801) ns1::Traits::c; /* Ruby, wrong constant name */
9
%feature("hello") A<int>;
10
%feature("hello") A<double,double>;
11
%feature("hi") A<int,int>;
12
%feature("hi") A<double>;
16
int foo() { return 1; }
19
%extend A<double,double>
21
int foo() { return 1; }
26
int bar() { return 1; }
31
int bar() { return 1; }
36
int bar() { return 1; }
50
template <class T1, class T2 = T1>
55
%typemap(in) A * { /* in A */ }
57
%typemap(out) A * { /* out A */ $result=0; }
59
%typemap(out) A * { /* out A */ }
64
typedef unsigned int category;
66
const category one = 1;
67
const category two = 1;
70
template <class T1, category C = one, class T2 = Parm>
75
%typemap(in) N * { /* in N */ }
77
%typemap(out) N * { /* out N */ $result=0; }
79
%typemap(out) N * { /* out N */ }
90
%template(A_p) ns1::ns2::A<double,ns1::ns2::Parm>;
91
%template(N_1p) ns1::ns2::N<int>;
96
%template(A_ii) A<int, int>;
97
%template(A_d) A<double>;
98
%template(N_d) N<double>;
113
struct C : N<double,ns1::ns2::one>
118
A<int> *get_a1(A<int> *a) {
122
A<int,int> *get_a2(A<int,int> *a) {
135
static const ns2::category c = ns2::one;
140
struct D : ns2::N<double,T::c>
148
template <class T1, class T2 = D<T1> >
157
%template(Do) ns1::ns4::D<ns1::Traits>;
158
%template(Bo) ns1::ns4::Base<ns1::Traits, ns1::ns4::D<ns1::Traits> >;
166
struct Der : ns4::Base<Traits>
183
template<class T1, class T2 = T1> class CTemplate
187
typedef CTemplate<CFoo> TBla; // OK
188
typedef void (*TFunc1)(CFoo arg); // OK
189
typedef void (*TFunc2)(CTemplate<CFoo> arg); // OK
190
typedef void (*TFunc3)(CTemplate<CFoo>* arg); // OK
192
int foo(TFunc1 a, TFunc2 b, TFunc3 c)
200
%include std_vector.i
207
void g(std::vector<double>* s = 0) {}
208
void q(double = 0) {}
212
%constant void (*Bf)(std::vector<double> *p = 0) = g;
213
%constant void (*Cf)(double = 0) = q;