I'm writting a library in C++ which I'll use in Elixir/Erlang. There're C++ methods that accept and return, including via out parameters, and involving pointers, data structures or library from std library such as: tuples, vectors, priority queues, bitsets and so forth. And also methods that accept or return generics. Or my own custom data structures.
How do I export such methods?
template<class T1>
std::array<MyStruc1, 24> my_func(
const T1& a1,
int b1,
int c1,
unordered_map<MyStruc1, double>& d1,
unordered_map<MyStruc2, int>* e1=nullptr) {
///////
}
I'm familiar with, and have found examples, converting simple structures: char*, simple structs and primitive types only.