C++11 alias templates doc and changes file update

This commit is contained in:
William S Fulton 2016-11-02 10:05:39 +00:00
parent c74397bfd0
commit 20cd562e62
2 changed files with 10 additions and 1 deletions

View File

@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.11 (in progress)
============================
2016-11-02: liorgold
Patch #741 - Add support for C++11 alias templates, see updated CPlusPlus11.html
documentation.
2016-10-30: myd7349
[C#] Patch #740 Add std_array.i for C# for wrapping std::array.

View File

@ -639,7 +639,7 @@ using TypedefName = SomeType<char*, T2, 5>;
<p>
SWIG supports both type aliasing and alias templates.
However, in order to use an alias template, the <tt>%template</tt> directive must be used:
However, in order to use an alias template, two <tt>%template</tt> directives must be used:
</p>
<div class="code"><pre>
@ -647,6 +647,11 @@ However, in order to use an alias template, the <tt>%template</tt> directive mus
%template() TypedefName&lt;bool&gt;;
</pre></div>
<p>Firstly, the actual template is instantiated with a name to be used by the target language, as per any template being wrapped.
Secondly, the empty template instantiation, <tt>%template()</tt>, is required for the alias template.
This second requirement is necessary to add the appropriate instantiated template type into the type system as SWIG does not automatically instantiate templates.
See the <a href="SWIGPlus.html#SWIGPlus_nn30">Templates</a> section for more general information on wrapping templates.
<H3><a name="CPlusPlus11_unrestricted_unions">7.2.17 Unrestricted unions</a></H3>