summaryrefslogtreecommitdiff
path: root/Examples/test-suite/li_std_vector_ptr.i
blob: 292c9d7005de89a0c42b409dba28b6f230adea00 (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
// Bug 2359417
%module li_std_vector_ptr

%include "std_vector.i"

%template(IntPtrVector) std::vector<int *>;

%inline %{
#include <iostream>
using namespace std;
int* makeIntPtr(int v) {
  return new int(v);
}
double* makeDoublePtr(double v) {
  return new double(v);
}

#if 1
int** makeIntPtrPtr(int* v) {
  return new int*(v);
}
#endif

void displayVector(std::vector<int *> vpi) {
  cout << "displayVector..." << endl;
  for (int i=0; i<vpi.size(); ++i)
    cout << *vpi[i] << endl;
}
%}