summaryrefslogtreecommitdiff
path: root/Examples/test-suite/cpp11_null_pointer_constant.i
blob: 0b3276a44b41c2ab8cd0ec85dfe9800cb5233803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* This testcase checks whether SWIG correctly treats the new nullptr_t
   constant introduced in C++11.
*/

%module cpp11_null_pointer_constant

%feature("autodoc") A::NullPtrMethod; // Triggers conversion of nullptr to None, nil etc in target language
%feature("compactdefaultargs") A::NullPtrMethod;

%inline %{

const int *const MyIntegerPtr = nullptr;

class A {
public:
  A() : _myA(nullptr) { }

  A *_myA;
  
  void NullPtrMethod(double *ptr = nullptr) {}  
};
%}