mirror of https://github.com/swig/swig
add doc on %attribute and templates (#2224)
Document behaviour found in #2142
This commit is contained in:
parent
27bdbc1f05
commit
bb36862872
|
@ -45,6 +45,9 @@
|
|||
<ul>
|
||||
<li><a href="#Library_nn17">exception.i</a>
|
||||
<li><a href="#Library_attributes">attribute.i</a>
|
||||
<ul>
|
||||
<li><a href="#Library_attribute_templates">%attribute and C++ templates</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -2327,6 +2330,24 @@ shared_ptr which has <tt>%naturalvar</tt> turned on in
|
|||
<tt>%shared_ptr</tt>.
|
||||
</p>
|
||||
|
||||
|
||||
<H4><a name="Library_attribute_templates">12.5.2.1 %attribute and C++ templates</a></H4>
|
||||
<p>
|
||||
<tt>%attribute</tt> and friends have to be used on fully specified classes. For example
|
||||
</p>
|
||||
<div class="code">
|
||||
<pre>
|
||||
%attributeref(A<int>, int, a);
|
||||
%inline %{
|
||||
template <class T> struct A {
|
||||
T a() const;
|
||||
void a(T &);
|
||||
};
|
||||
%}
|
||||
</pre>
|
||||
</div>
|
||||
<p>
|
||||
Note the use of a template-id (i.e., <tt>A<int></tt> not <tt>A<T></tt> or just <tt>A</tt>).
|
||||
This means that <tt>%attribute</tt> statements have to be repeated for any template-id that you want to use with <tt>%template</tt>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue