import source from 1.3.40
[external/swig.git] / Examples / test-suite / typename.i
1 %module "typename"
2
3 // Tests the typename handling in templates.  
4
5 %inline %{
6 class Foo {
7 public:
8     typedef double Number;
9     Number blah() {
10         return 2.1828;
11     }
12 };
13
14 class Bar {
15 public:
16    typedef int Number;
17    Number blah() {
18        return 42;
19    }
20 };
21
22 template<typename T> typename T::Number twoblah(T &obj) {
23    return 2*(obj.blah());
24 }
25
26 Bar::Number spam() { return 3; }
27
28 %}
29
30 %template(twoFoo) twoblah<Foo>;
31 %template(twoBar) twoblah<Bar>;
32
33
34