mmomtchev / swig

This is SWIG JavaScript Evolution, a fork of the SWIG project with modern JavaScript/TypeScript support including WASM and async
http://www.swig.org
Other
7 stars 0 forks source link

`$T0type` expansion used by NAPI `std_vector.i` does not support templated classes #43

Closed mmomtchev closed 3 months ago

mmomtchev commented 3 months ago
// Node-API specific implementations
// (with copy-conversion)
%module napi_li_std_vector

// Convert all return values
%apply(std::vector RETURN)            { std::vector };
%apply(std::vector *RETURN)           { std::vector *, std::vector & };

%inline {
  std::vector<std::pair<std::string, std::string>> return_vector_pair() {
    return { { "a", "1" }, { "b", "2" } };
  }
}
../../../Lib/javascript/napi/std_vector.i:176: Error: Syntax error in: $typemap(out, std::pair<(std::string, 1=c_val, result=js_val, argnum=array value);
    array.Set(i, js_val);
  }
  $result = array;
}