PageRenderTime 12ms CodeModel.GetById 10ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 34 lines | 24 code | 10 blank | 0 comment | 0 complexity | 42c3512403b9bc08a499494676248b20 MD5 | raw file
 1%module "typename"
 2
 3// Tests the typename handling in templates.  
 4
 5%inline %{
 6class Foo {
 7public:
 8    typedef double Number;
 9    Number blah() {
10        return 2.1828;
11    }
12};
13
14class Bar {
15public:
16   typedef int Number;
17   Number blah() {
18       return 42;
19   }
20};
21
22template<typename T> typename T::Number twoblah(T &obj) {
23   return 2*(obj.blah());
24}
25
26Bar::Number spam() { return 3; }
27
28%}
29
30%template(twoFoo) twoblah<Foo>;
31%template(twoBar) twoblah<Bar>;
32
33
34