diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2017-07-30 13:41:45 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2017-08-16 00:24:25 +0100 |
commit | 7ee76f93f99e01c9fb5de0bd91ab16178519f18c (patch) | |
tree | e1ba0b20c1ed10aedfddde1ceea356dedde19a7d /Doc/Manual/SWIGPlus.html | |
parent | 8753f9652ccc91f0aa080efff15207a4fa33c8ec (diff) | |
download | swig-7ee76f93f99e01c9fb5de0bd91ab16178519f18c.tar.gz |
More consistent formatting of examples in documentation
Diffstat (limited to 'Doc/Manual/SWIGPlus.html')
-rw-r--r-- | Doc/Manual/SWIGPlus.html | 62 |
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<class T> 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 < 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 < maxitems) { + data[nitems++] = obj; } + } + int length() { + return nitems; + } + T get(int n) { + return data[n]; + } }; </pre></div> @@ -3704,10 +3704,10 @@ template <class T> 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<class T> class SmartPtr { - T *pointee; + T *pointee; public: - SmartPtr(T *p) : pointee(p) { ... } - T *operator->() { - return pointee; - } - ... + SmartPtr(T *p) : pointee(p) { ... } + T *operator->() { + return pointee; + } + ... }; // Ordinary class |