html fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6632 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0dc3099ead
commit
3ef946d2d1
13 changed files with 51 additions and 51 deletions
|
|
@ -26,7 +26,7 @@ you might have an operator like this:
|
|||
|
||||
<blockquote>
|
||||
<pre>
|
||||
Vector operator+(const Vector &a, const Vector &b) {
|
||||
Vector operator+(const Vector &a, const Vector &b) {
|
||||
Vector result;
|
||||
result.x = a.x + b.x;
|
||||
result.y = a.y + b.y;
|
||||
|
|
@ -40,7 +40,7 @@ or a function:
|
|||
|
||||
<blockquote>
|
||||
<pre>
|
||||
Vector addv(const Vector &a, const Vector &b) {
|
||||
Vector addv(const Vector &a, const Vector &b) {
|
||||
Vector result;
|
||||
result.x = a.x + b.x;
|
||||
result.y = a.y + b.y;
|
||||
|
|
@ -67,7 +67,7 @@ The prototypical example is an operator like this:
|
|||
|
||||
<blockquote>
|
||||
<pre>
|
||||
Vector &operator[](int index);
|
||||
Vector &operator[](int index);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ or a method:
|
|||
|
||||
<blockquote>
|
||||
<pre>
|
||||
Vector &get(int index);
|
||||
Vector &get(int index);
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
|
|
@ -84,8 +84,8 @@ For functions returning references, a wrapper like this is created:
|
|||
<blockquote>
|
||||
<pre>
|
||||
Vector *wrap_Object_get(Object *self, int index) {
|
||||
Vector &result = self->get(index);
|
||||
return &result;
|
||||
Vector &result = self->get(index);
|
||||
return &result;
|
||||
}
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
|
@ -107,10 +107,10 @@ class VectorArray {
|
|||
public:
|
||||
...
|
||||
%addmethods {
|
||||
Vector &get(int index) {
|
||||
Vector &get(int index) {
|
||||
return (*self)[index];
|
||||
}
|
||||
void set(int index, Vector &a) {
|
||||
void set(int index, Vector &a) {
|
||||
(*self)[index] = a;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ double Foo = 3.0;
|
|||
int gcd(int x, int y) {
|
||||
int g;
|
||||
g = y;
|
||||
while (x > 0) {
|
||||
while (x > 0) {
|
||||
g = x;
|
||||
x = y % x;
|
||||
y = g;
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ template<class T> class vector {
|
|||
v = new T[_sz];
|
||||
sz = _sz;
|
||||
}
|
||||
T &get(int index) {
|
||||
T &get(int index) {
|
||||
return v[index];
|
||||
}
|
||||
void set(int index, T &val) {
|
||||
void set(int index, T &val) {
|
||||
v[index] = val;
|
||||
}
|
||||
#ifdef SWIG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue