summaryrefslogtreecommitdiff
path: root/Examples/test-suite/cpp11_rvalue_reference.i
blob: 45ee06354f3a2f2d608cc17095ca289fb0c57d77 (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 parses the double ampersand &&
   move operator which is currently mapped to the reference & operator. */
%module cpp11_rvalue_reference

%inline %{
#include <utility>
class A {
public:
  int  getAcopy() { return _a; }
  int *getAptr()  { return &_a; }
  int &getAref()  { return _a; }
  int &&getAmove() { return std::move(_a); }

  void setAcopy(int a) { _a = a; }
  void setAptr(int *a)  { _a = *a; }
  void setAref(int &a)  { _a = a; }
  void setAmove(int &&a) { _a = a; }

private:
  int _a;
};
%}