PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/template_typedef_ptr.i

#
Swig | 38 lines | 21 code | 10 blank | 7 comment | 0 complexity | 60a4cb7d6370801675c33a4019db0fdb MD5 | raw file
 1%module("templatereduce") template_typedef_ptr
 2
 3%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Test<int, C*>; /* Ruby, wrong constant name */
 4
 5 /*
 6   Use the "templatereduce" feature to force swig to reduce the template
 7   typedef as much as possible.
 8
 9   This fixes cases like this one, but it can prevent some
10   typemaps from working.
11 */
12
13%inline %{
14 struct C{};
15 typedef C* pC;
16
17 template <class A, class B>
18   struct Test 
19   {
20     Test (A a, B b)
21     {
22     }
23     
24   };
25
26 
27 template <class A, class B>
28   struct Test<A, B*> 
29   {
30     Test (B* a)
31     {
32     }
33     
34   };
35%}
36
37  
38%template(test_pC) Test<int, pC>;