mirror of https://github.com/swig/swig
Eliminate trivial differences between the reference examples
This commit is contained in:
parent
37cd1474b5
commit
ac1f067ce9
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
@ -40,7 +40,3 @@ public:
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
|
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
@ -40,7 +40,3 @@ public:
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
|
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
@ -40,7 +40,3 @@ public:
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
/* File : example.i */
|
||||
|
||||
/* This example has nothing to do with references but the name is used by all
|
||||
* the other languages so it's hard to rename to something more meaningful.
|
||||
*
|
||||
* Mostly it shows how to use %extend.
|
||||
*/
|
||||
/* This file has a few "typical" uses of C++ references. */
|
||||
|
||||
%module example
|
||||
|
||||
|
@ -33,8 +29,8 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
printf("VectorArray extended get: %p %d\n", (void *)$self, index);
|
||||
|
|
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
@ -42,7 +42,3 @@ public:
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ class Vector {
|
|||
private:
|
||||
double x,y,z;
|
||||
public:
|
||||
Vector() : x(0), y(0), z(0) { };
|
||||
Vector(double x, double y, double z) : x(x), y(y), z(z) { };
|
||||
Vector() : x(0), y(0), z(0) { }
|
||||
Vector(double x, double y, double z) : x(x), y(y), z(z) { }
|
||||
friend Vector operator+(const Vector &a, const Vector &b);
|
||||
char *print();
|
||||
};
|
||||
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
@ -40,7 +40,3 @@ public:
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ class Vector {
|
|||
private:
|
||||
double x,y,z;
|
||||
public:
|
||||
Vector() : x(0), y(0), z(0) { };
|
||||
Vector(double x, double y, double z) : x(x), y(y), z(z) { };
|
||||
Vector() : x(0), y(0), z(0) { }
|
||||
Vector(double x, double y, double z) : x(x), y(y), z(z) { }
|
||||
friend Vector operator+(const Vector &a, const Vector &b);
|
||||
char *print();
|
||||
};
|
||||
|
@ -20,7 +20,3 @@ public:
|
|||
Vector &operator[](int);
|
||||
int size();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
VectorArray(int maxsize);
|
||||
~VectorArray();
|
||||
int size();
|
||||
|
||||
|
||||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
|
@ -40,7 +40,3 @@ public:
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue