aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/template_default_arg.i
blob: 1b3612f73dec853f9dee77e0f86bcf2bf3f8086e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%module template_default_arg

%warnfilter(801) hi;	/* Ruby, wrong class name */

%inline %{
  template <class T>
    struct Hello
    {
      typedef unsigned int size_type;

      // This works
      // Hello(size_type n = Hello<T>::size_type(0) ) { }

      // This doesn't
      Hello(size_type n = size_type(0) ) { }
      
    };
%}

%template(Hello_int) Hello<int>;

%inline %{

  struct hi : Hello<int>
  {
    hi(size_type n) : Hello<int>(n)
    {
    }
    
  };
%}