PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/li_std_vector_ptr.i

#
Swig | 30 lines | 24 code | 6 blank | 0 comment | 0 complexity | a401c6c75d8e345569d2c8a9dce05b18 MD5 | raw file
 1// Bug 2359417
 2%module li_std_vector_ptr
 3
 4%include "std_vector.i"
 5
 6%template(IntPtrVector) std::vector<int *>;
 7
 8%inline %{
 9#include <iostream>
10using namespace std;
11int* makeIntPtr(int v) {
12  return new int(v);
13}
14double* makeDoublePtr(double v) {
15  return new double(v);
16}
17
18#if 1
19int** makeIntPtrPtr(int* v) {
20  return new int*(v);
21}
22#endif
23
24void displayVector(std::vector<int *> vpi) {
25  cout << "displayVector..." << endl;
26  for (int i=0; i<vpi.size(); ++i)
27    cout << *vpi[i] << endl;
28}
29%}
30