Merge branch 'liorgold-alias-template'
* liorgold-alias-template: Warning header cosmetics Fix decl attribute in C++11 alias templates Add C++11 alias templates
This commit is contained in:
commit
c74397bfd0
7 changed files with 132 additions and 61 deletions
|
|
@ -622,20 +622,15 @@ which is equivalent to the old style typedef:
|
|||
typedef void (*PFD)(double); // The old style
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
SWIG supports type aliasing.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The following is an example of an alias template:
|
||||
|
||||
<div class="code"><pre>
|
||||
template< typename T1, typename T2, int >
|
||||
template< typename T1, typename T2, int N >
|
||||
class SomeType {
|
||||
public:
|
||||
T1 a;
|
||||
T2 b;
|
||||
int c;
|
||||
};
|
||||
|
||||
template< typename T2 >
|
||||
|
|
@ -643,14 +638,14 @@ using TypedefName = SomeType<char*, T2, 5>;
|
|||
</pre></div>
|
||||
|
||||
<p>
|
||||
These are partially supported as SWIG will parse these and identify them, however, they are ignored as they are not added to the type system. A warning such as the following is issued:
|
||||
SWIG supports both type aliasing and alias templates.
|
||||
However, in order to use an alias template, the <tt>%template</tt> directive must be used:
|
||||
</p>
|
||||
|
||||
<div class="shell">
|
||||
<pre>
|
||||
example.i:13: Warning 342: The 'using' keyword in template aliasing is not fully supported yet.
|
||||
</pre>
|
||||
</div>
|
||||
<div class="code"><pre>
|
||||
%template(SomeTypeBool) SomeType<char*, bool, 5>;
|
||||
%template() TypedefName<bool>;
|
||||
</pre></div>
|
||||
|
||||
<H3><a name="CPlusPlus11_unrestricted_unions">7.2.17 Unrestricted unions</a></H3>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue