~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/test-suite/typename.i

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
       
 
 
b'\\ No newline at end of file'