summaryrefslogtreecommitdiff
path: root/Examples/test-suite/cpp11_decltype.i
blob: deedd59532bc2add0a124dfeeca5e11bad2cffb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* This testcase checks whether SWIG correctly uses the new 'decltype()'
   introduced in C++11.
*/
%module cpp11_decltype

%inline %{
  class A {
  public:
    int i;
    decltype(i) j;

    auto foo( decltype(i) a ) -> decltype(i) {
      if (a==5)
        return 10;
      else
        return 0;
    }
  };
  %}