Update docs for expression parsing improvements
This commit is contained in:
parent
713438e879
commit
8f54f6180a
2 changed files with 13 additions and 7 deletions
|
|
@ -3057,22 +3057,24 @@ is expected in an interface file. For example:
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
void foo(vector<int> *a, int n);
|
void foo(vector<int> *a, int n);
|
||||||
void bar(list<int, 100> *x);
|
void bar(std::array<int, 100> *x);
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There are some restrictions on the use of non-type arguments. Simple literals
|
There are some restrictions on the use of non-type arguments. Simple literals
|
||||||
are supported, and so are some constant expressions. However, use of '<'
|
are supported, and so are most constant expressions. However, there are some
|
||||||
and '>' within a constant expressions currently is not supported by SWIG
|
limitations on the use of '<' and '>' in constant expressions (but note
|
||||||
('<=' and '>=' are though). For example:
|
that '<=' and '>=' are fully supported). For example:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
void bar(list<int, 100> *x); // OK
|
void bar(std::array<int, 100> *x); // OK
|
||||||
void bar(list<int, 2*50> *x); // OK
|
void bar(std::array<int, 2*50> *x); // OK
|
||||||
void bar(list<int, (2>1 ? 100 : 50)> *x) // Not supported
|
void bar(std::array<int, (1<2 ? 100 : 50)> *x) // OK
|
||||||
|
void bar(std::array<int, 1<2 ? 100 : 50> *x) // Not supported
|
||||||
|
void bar(std::array<int, (2>1 ? 100 : 50)> *x) // Not supported
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,8 @@ isPointer = false
|
||||||
int a;
|
int a;
|
||||||
int test2(int b = 9%a) { return b; }
|
int test2(int b = 9%a) { return b; }
|
||||||
|
|
||||||
|
/* Example from manual. */
|
||||||
|
#include <array>
|
||||||
|
void bar(std::array<int, (1<2? 100 : 50)> *x) { }
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue