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

/tags/rel-1-3-26/SWIG/Examples/test-suite/template_enum_ns_inherit.i

#
Swig | 48 lines | 38 code | 10 blank | 0 comment | 0 complexity | 8b1ef3b6cc6c6fef8bd9c06fc29b2b00 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1%module template_enum_ns_inherit
 2%inline %{
 3 
 4  namespace oss
 5  {
 6    enum Polarization { UnaryPolarization, BinaryPolarization };
 7 
 8    template <Polarization P>
 9    struct Interface
10    {
11    };
12
13    template <Polarization P, class C>
14    struct Module
15    {
16    };
17
18  }
19 
20%}                                                 
21 
22namespace oss
23{
24  %template(Interface_UP) Interface<UnaryPolarization>;
25  %template(Module_UPIUP) Module<UnaryPolarization,Interface<UnaryPolarization> >;
26}
27 
28%inline %{
29  namespace oss
30  {
31    namespace hello
32    {
33      struct HInterface1 :
34           Interface<oss::UnaryPolarization>  // this works (with fullns qualification)
35      {
36      };
37 
38      struct HInterface2 :
39          Interface<UnaryPolarization>       // this doesn't work
40      {
41      };
42 
43     struct HModule1 : Module<UnaryPolarization, Interface<UnaryPolarization> > {
44 };
45
46    }
47  }
48%}