Added support for type alias
This commit is contained in:
parent
86fd5c9858
commit
c363a93d69
5 changed files with 121 additions and 53 deletions
|
|
@ -29,7 +29,7 @@
|
|||
<li><a href="#CPlusPlus11_strongly_typed_enumerations">Strongly typed enumerations</a>
|
||||
<li><a href="#CPlusPlus11_double_angle_brackets">Double angle brackets</a>
|
||||
<li><a href="#CPlusPlus11_explicit_conversion_operators">Explicit conversion operators</a>
|
||||
<li><a href="#CPlusPlus11_alias_templates">Alias templates</a>
|
||||
<li><a href="#CPlusPlus11_alias_templates">Type alias and alias templates</a>
|
||||
<li><a href="#CPlusPlus11_unrestricted_unions">Unrestricted unions</a>
|
||||
<li><a href="#CPlusPlus11_variadic_templates">Variadic templates</a>
|
||||
<li><a href="#CPlusPlus11_new_string_literals">New string literals</a>
|
||||
|
|
@ -603,8 +603,27 @@ Conversion operators either with or without <tt>explicit</tt> need renaming to a
|
|||
them available as a normal proxy method.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_alias_templates">7.2.16 Alias templates</a></H3>
|
||||
<H3><a name="CPlusPlus11_alias_templates">7.2.16 Type alias and alias templates</a></H3>
|
||||
|
||||
<p>
|
||||
A type alias is a statement of the form:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
using PFD = void (*)(double); // New introduced syntax
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
which is equivalent to the old style typedef:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
typedef void (*PFD)(double); // The old style
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
SWIG supports this kind of statements.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The following is an example of an alias template:
|
||||
|
|
@ -632,31 +651,6 @@ example.i:13: Warning 342: The 'using' keyword in template aliasing is not fully
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Similarly for non-template type aliasing:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
using PFD = void (*)(double); // New introduced syntax
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
A warning will be issued:
|
||||
</p>
|
||||
|
||||
<div class="shell">
|
||||
<pre>
|
||||
example.i:17: Warning 341: The 'using' keyword in type aliasing is not fully supported yet.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
||||
<p>The equivalent old style typedefs can be used as a workaround:</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
typedef void (*PFD)(double); // The old style
|
||||
</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