Re: SWIG syntax error on list initializer of template ctor parameter
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <20200930171512.pmjweqd2ivr33mzi@70-36-235-101.dsl.static.fusionbroadband.com> |
> You can work around it by declaring your variable using this syntax instead:
>
> const A<char, 3> A3 = A(std::array<char, 3>{'A','B','C'});
Trying that gets me:
```
AJAVA_wrap.cxx: In function 'jlong Java_exampleJNI_A3_1get(JNIEnv*, jclass)':
AJAVA_wrap.cxx:242:15: error: no matching function for call to 'A<char, 3>::A()'
A< char,3 > result;
^~~~~~
```
AJAVA_wrap.cxx lines 240-249:
```
SWIGEXPORT jlong JNICALL Java_exampleJNI_A3_1get(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0;
A< char,3 > result;
(void)jenv;
(void)jcls;
result = (A< char,3 >)A3;
*(A< char,3 > **)&jresult = new A< char,3 >((const A<char, 3> &)result);
return jresult;
}
```