summaryrefslogtreecommitdiff
path: root/Doc/Manual/SWIGPlus.html
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2017-07-30 13:41:45 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2017-08-16 00:24:25 +0100
commit7ee76f93f99e01c9fb5de0bd91ab16178519f18c (patch)
treee1ba0b20c1ed10aedfddde1ceea356dedde19a7d /Doc/Manual/SWIGPlus.html
parent8753f9652ccc91f0aa080efff15207a4fa33c8ec (diff)
downloadswig-7ee76f93f99e01c9fb5de0bd91ab16178519f18c.tar.gz
More consistent formatting of examples in documentation
Diffstat (limited to 'Doc/Manual/SWIGPlus.html')
-rw-r--r--Doc/Manual/SWIGPlus.html62
1 files changed, 31 insertions, 31 deletions
diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html
index b22f1c279..5841c7d43 100644
--- a/Doc/Manual/SWIGPlus.html
+++ b/Doc/Manual/SWIGPlus.html
@@ -2958,29 +2958,29 @@ To illustrate, consider the following template definition:
<div class="code"><pre>
template&lt;class T&gt; class List {
private:
- T *data;
- int nitems;
- int maxitems;
+ T *data;
+ int nitems;
+ int maxitems;
public:
- List(int max) {
- data = new T [max];
- nitems = 0;
- maxitems = max;
- }
- ~List() {
- delete [] data;
- };
- void append(T obj) {
- if (nitems &lt; maxitems) {
- data[nitems++] = obj;
- }
- }
- int length() {
- return nitems;
- }
- T get(int n) {
- return data[n];
+ List(int max) {
+ data = new T [max];
+ nitems = 0;
+ maxitems = max;
+ }
+ ~List() {
+ delete [] data;
+ };
+ void append(T obj) {
+ if (nitems &lt; maxitems) {
+ data[nitems++] = obj;
}
+ }
+ int length() {
+ return nitems;
+ }
+ T get(int n) {
+ return data[n];
+ }
};
</pre></div>
@@ -3704,10 +3704,10 @@ template &lt;class T&gt; class OuterTemplateClass {};
// Don't forget to use %feature("flatnested") for OuterClass::InnerStruct and
// OuterClass::InnerClass if the target language doesn't support nested classes.
class OuterClass {
- public:
- // Forward declarations:
- struct InnerStruct;
- class InnerClass;
+ public:
+ // Forward declarations:
+ struct InnerStruct;
+ class InnerClass;
};
struct OuterClass::InnerStruct {};
@@ -4533,13 +4533,13 @@ around some other class. For example:
<pre>
// Smart-pointer class
template&lt;class T&gt; class SmartPtr {
- T *pointee;
+ T *pointee;
public:
- SmartPtr(T *p) : pointee(p) { ... }
- T *operator-&gt;() {
- return pointee;
- }
- ...
+ SmartPtr(T *p) : pointee(p) { ... }
+ T *operator-&gt;() {
+ return pointee;
+ }
+ ...
};
// Ordinary class