Eliminate trivial differences between the reference examples

This commit is contained in:
Olly Betts 2014-11-05 10:43:42 +13:00
commit ac1f067ce9
18 changed files with 15 additions and 79 deletions

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -40,7 +40,3 @@ public:
} }
} }
}; };

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -40,7 +40,3 @@ public:
} }
} }
}; };

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -40,7 +40,3 @@ public:
} }
} }
}; };

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -1,10 +1,6 @@
/* File : example.i */ /* File : example.i */
/* This example has nothing to do with references but the name is used by all /* This file has a few "typical" uses of C++ references. */
* the other languages so it's hard to rename to something more meaningful.
*
* Mostly it shows how to use %extend.
*/
%module example %module example
@ -34,7 +30,7 @@ public:
~VectorArray(); ~VectorArray();
int size(); int size();
/* This wrapper provides an alternative to the [] operator */ /* This wrapper provides an alternative to the [] operator */
%extend { %extend {
Vector &get(int index) { Vector &get(int index) {
printf("VectorArray extended get: %p %d\n", (void *)$self, index); printf("VectorArray extended get: %p %d\n", (void *)$self, index);

View file

@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -42,7 +42,3 @@ public:
} }
} }
}; };

View file

@ -4,8 +4,8 @@ class Vector {
private: private:
double x,y,z; double x,y,z;
public: public:
Vector() : x(0), y(0), z(0) { }; Vector() : x(0), y(0), z(0) { }
Vector(double x, double y, double z) : x(x), y(y), z(z) { }; Vector(double x, double y, double z) : x(x), y(y), z(z) { }
friend Vector operator+(const Vector &a, const Vector &b); friend Vector operator+(const Vector &a, const Vector &b);
char *print(); char *print();
}; };
@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -40,7 +40,3 @@ public:
} }
} }
}; };

View file

@ -4,8 +4,8 @@ class Vector {
private: private:
double x,y,z; double x,y,z;
public: public:
Vector() : x(0), y(0), z(0) { }; Vector() : x(0), y(0), z(0) { }
Vector(double x, double y, double z) : x(x), y(y), z(z) { }; Vector(double x, double y, double z) : x(x), y(y), z(z) { }
friend Vector operator+(const Vector &a, const Vector &b); friend Vector operator+(const Vector &a, const Vector &b);
char *print(); char *print();
}; };
@ -20,7 +20,3 @@ public:
Vector &operator[](int); Vector &operator[](int);
int size(); int size();
}; };

View file

@ -40,7 +40,3 @@ public:
} }
} }
}; };