Open dsogari opened 8 months ago
std::list
will be the same as std::vector
and in fact the best way to do it is to probably transform the current std::vector
maps so that they can be used with any STL that supports forward iterators.
However std::set
is much problematic since the JS Set
does not have a C++ API, it is a userland implementation and any C++ wrapper will have to call the JS methods.
Hm, I guess you're right. But isn't it just a matter of providing an interface matching the JS Set
, instead of actually using a JS Set
? A user might complain about lack of idiomaticity, but at least they can call their functions.
This you can already do: you can simply wrap std::set
by using %template(IntegerSet) std::set<int>;
and you will get a JavaScript-accessible class called IntegerSet
that will be fully usable. But you won't have transparent and automatic conversion of arguments.
Sorry to bother you again... :P
It appears that
std::set
andstd::list
are not supported for JavaScript, although they are supported for languages such as Java, Ruby and Python. Would it be too difficult to implement this feature? I would definitely tackle this myself if I had enough knowledge of the SWIG codebase. If you can give me some pointers, I could give it a shot.